/*
 * This is the generic Window Popup script.
 * To link link this script to your page:
 * <script language="javascript" src="/gsol/pex/en/warat/includes/winpopup.js"></script>
 * Where:
 * page = 'URL of file to popup' (ex. '/gsol/pex/en/warat/jsp/test.jsp?param=value')
 * height = 'height in pixels' (ex. '640')
 * width = 'width in pixels' (ex. '480')
 * windowname = 'name of target window' (ex. 'HelpWindow')
 * scrollbars = 'yes' or 'no'
 */
function winPop(page,height,width,windowname,scrollbars)
{
	params = "height=" + height + ",width=" + width + ",status=yes,toolbar=no,directories=no,menubar=no,location=no,scrollbars=" + scrollbars + ",resizable=yes,top=50,left=50,screenX=50,screenY=50"
	popWindow = open(page,windowname,params);
	//popWindow.focus();
}

function winPop2(url,h,w)
{
 parameter = "height=" + h + ",width=" + w + ",status=yes,toolbar=yes,directories=no,menubar=yes,location=yes,scrollbars=yes,resizable=yes,top=20,left=50,screenX=50,screenY=50"
 opWindow = open(url,"",parameter);
}

function winPop3(page,height,width,windowname)
{
	params = "height=" + height + ",width=" + width + ",status=no,toolbar=no,directories=no,menubar=no,location=no,scrollbars=no,resizable=yes,top=50,left=50,screenX=50,screenY=50"
	popWindow = open(page,windowname,params);
	//popWindow.focus();
}

// opens a pop-up window with set width and height, with scroll bars, resizeable
function winPop4(url,height,width) {
	params = "height=" + height + ",width=" + width + ",status=no,toolbar=no,directories=no,menubar=no,location=no,scrollbars=yes,resizable=yes,top=50,left=50,screenX=50,screenY=50"
	popHelp = open(url,"HelpWindow",params);
	popHelp.focus()
}	

function pop(page,height,width)
{
 	params = "height=" + height + ",width=" + width + ",status=1,toolbar=0,directories=0,menubar=0,location=0,scrollbars=1,resizable=1,top=50,left=50,screenX=50,screenY=50";
 	popup = window.open(page,"PopupWindow",params);
 	popup.focus();
}
function spellCheck(url,fieldId) {			

	if(chkTxAreas(document.getElementById(fieldId).value))
	{
		if(fieldId=='Comment[0]')
		{
		windowName="SpellCheck1";
		}
		else
	        {
		windowName="SpellCheck2";
		}//if	

		url=url+"&input=fld_"+fieldId;
		winPop(url,400, 600, windowName, "yes");		
	}//if
}

function openbig(link) {
	msg=open(link,"DisplayWindow1","HEIGHT=440,WIDTH=640,status=1,toolbar=1,directories=1,menubar=1,location=1,scrollbars=1,resizable=1,top=50,left=50");
	msg.focus();
}

function popvideo(page,height,width)
{
 	params = "height=" + height + ",width=" + width + ",status=0,toolbar=0,directories=0,menubar=0,location=0,scrollbars=0,resizable=0,top=50,left=50,screenX=50,screenY=50";
 	popup = window.open(page,"VideoWindow",params);
 	popup.focus();
}
function chkTxAreas(txtAreaVal) {
		
			if (txtAreaVal.length>1500 )
			{
			var errMsg = "Your message is too long.";						
			alert(errMsg);
			return false;
			}
			else
			{
			return true;
			}
}	
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}
