function MakePrintWindow(WidthValue)
{
	var win = window.open("","PrintWindow","width=502,height=600,toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no");	
}
			
function openSendDialogBox(pageurl, pagetitle)
{
	var win = window.open("/dfdsseaways/SendPage.aspx?title="+pagetitle+"&url="+pageurl,"sendpagedialog", "width=359,height=225,toolbar=no,scrollbars=no,directories=no,status=no,menubar=no")
}


// This function opens the internal link webform.
function getInternalLink(fieldobj)
{
	var obj = eval("document.all['" + fieldobj+"']");
	obj.value = showModalDialog("/dfdsseaways/WebForms/InternalLinksDialog.aspx", "", "resizable: no; help: no; status: no; scroll: no; center: yes;  unadorned: yes; dialogHeight: 400px; dialogWidth: 400px;"); 
}


function openSelectMediaFileDialog(minX,maxX,minY,maxY, groupid, prefieldname, startpath)
{
	//minX				: minmum width of picture.
	//maxX				: maximum width of picture.
	//minY				: minmum height of picture.
	//maxY				: maximum height of picture.
	//groupid			: Allowed group type of pictures ( web pictures or document ).
	//prefieldname			: Prename of all the fields.
	//startpath			: Virtual start path.

	var of = eval("document.all['" + prefieldname + "path" + "']");
	var usedpath = of.value;
	var querystring = "minheight="+minY+"&maxheight="+maxY+"&minwidth="+minX+"&maxwidth="+maxX+"&filegroupid="+groupid+"&filepath="+usedpath;
	
	var values = new Array();
	// testvales
	//values[0] = "six/Sample.jpg";
	//values[1] = "100";
	//values[2] = "200";
		
	//OLD values = showModalDialog("/dfdsMediaFiles/selectfile.aspx?"+querystring, "", "resizable: no; help: no; status: no; scroll: no; center: yes;  unadorned: yes; dialogHeight: 530px; dialogWidth: 500px;");
	values = showModalDialog("/mediabank/SelectMediaFileBrowser.aspx", "", "status: no; dialogHeight: 550px; scroll: no; dialogWidth: 650px; center: yes;");

	var strPath = new String(values[0]);

	if ((strPath.length > 0) && (strPath.toLowerCase()!="undefined"))
	{
		of.value = strPath;
		// setting picture src, width and height.
		var opf = eval("document.all['" + prefieldname +"pic']");
		// alert("Debug: " + startpath+strPath + " w/h: " + values[1] + "/" + values[2]);
		opf.src = startpath+strPath;
		opf.width = values[1];
		opf.height = values[2];
		var hidden_width = eval("document.all['" + prefieldname +"width']");
		hidden_width.value = values[1];
		var hidden_height = eval("document.all['" + prefieldname +"height']");
		hidden_height.value = values[2];
		
	}
	//else
	//	alert("The return value (" + strPath + ") from SelectFile dialog was not correct. Please try again!");
}
