//"Code Library" for common client functions
function Wait(msec)
{
	var StartTime = new Date().getTime(), IncTime; 
	IncTime = StartTime;
	while((IncTime - StartTime) < msec)
	{
		IncTime = new Date().getTime();
	}
}//Wait

function LoadTrackingInfo(TrackingNumber)
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,width=615,height=550,top=0";
	var TrackingUrl = "";
	var TrackingWindow;
	
	TrackingUrl = window.location.protocol + "//" + window.location.host + "/kasmirweb/general/track.aspx?TrackingNumber=" + TrackingNumber;	
	TrackingWindow = window.open (TrackingUrl, "TrackingInfo", WinDetails);
	TrackingWindow.focus();

}//LoadTrackingInfo

function LoadSampleTrackingInfo(TrackingNumber)//LoadTrackingInfo(TrackingNumber)
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,width=615,height=550,top=0";
	var TrackingUrl = "";
	var TrackingWindow;
	
	TrackingUrl = window.location.protocol + "//" + window.location.host + "/kasmirweb/general/SampleTracking.htm";	
	TrackingWindow = window.open (TrackingUrl, "TrackingInfo", WinDetails);
	TrackingWindow.focus();

}//LoadTrackingInfo

function LoadDate(SelectedDate)
{
	document.getElementById(DateDestination).value = SelectedDate;
	document.getElementById(DateDestination).blur();
}

function GetDate(SourceControlId)
{
	var WinDetails = "scrollbars=no,resizable=no,toolbar=no,location=no,status=no,menubar=no,left=" + (window.screen.width /2 - 125) + ",top=75";
	var DatePicker;
	var CalendarUrl;
	DateDestination = SourceControlId;
	
	if (window.navigator.appName != "Netscape")
	{
		WinDetails += ",height=255,width=250";
		CalendarUrl = "../Components/Calendar/Datepicker.aspx";
	}
	else
	{
		WinDetails += ",height=285,width=250";
		CalendarUrl = "../Components/Calendar/Datepicker_NS.aspx"
	}
		
	DatePicker = window.open(CalendarUrl, 'DatePicker', WinDetails);
	DatePicker.focus();
}

function NormalizeControls(ButtonWidth)
{
	for (i = 0; i < document.forms[0].length; i++)
	{
		if (document.forms[0].elements[i].getAttribute("ElementType") == "Button")
			document.forms[0].elements[i].style.width = ButtonWidth;
	}
	
}//NormalizeControls

function OpenHelp()
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,width=450,height=410";
	var HelpWindow = window.open(window.location.protocol + "//" + window.location.host + "/kasmirweb/utilities/sys/help.aspx", "Help", WinDetails);
	HelpWindow.focus()
}//OpenHelp

function OpenHelpByParameter(SourceForm)
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,width=450,height=410";
	var HelpWindow = window.open(window.location.protocol + "//" + window.location.host + "/kasmirweb/utilities/sys/help.aspx?SourceFormID=" + SourceForm, "Help", WinDetails);
	HelpWindow.focus()
} //OpenHelp

function OpenHelpProductFinder(SourceForm) {


    var WinDetails = "scrollbars=yes,resizable=no,toolbar=no,location=no,status=no,menubar=no,width=550,height=520";
    var HelpWindow = window.open(window.location.protocol + "//" + window.location.host + "/kasmirweb/utilities/sys/help.aspx?SourceFormID=" + SourceForm, "Help", WinDetails);
    HelpWindow.focus()
} //OpenHelp
	
function Summary_ViewOrder(OrderType)
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=500,width=700";
	var OrderWindow;
	var AppHost;
	if (window.location.host == "www.kasmirfabricsonline.com")
		AppHost = "https://";
	else 
		AppHost = "http://";

	AppHost += window.location.host;
		
	OrderWindow = window.open(AppHost + "/kasmirweb/Orders/WebOrderPreview.aspx?Type=" + OrderType, "OrderPreview", WinDetails);
	OrderWindow.focus();
}//Summary_ViewOrder
	
function StyleOrderForm_OpenAvailableOptions()
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=400,width=450,left=" + (window.screen.width/2 - 225);
	var OptionsWindow;
	
	OptionsWindow = window.open("AvailableOptions.aspx", "AvailableOptions", WinDetails);
	OptionsWindow.focus();

}//StyleOrderForm_OpenAvailableOptions

function OpenBasicWindow(WindowUrl, WindowTitle, WindowHeight, WindowWidth)
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=" + WindowHeight + ",width=" + WindowWidth + ",top=0,left="  + ((window.screen.width/2) - (WindowWidth/2));
	var BasicWindow;
/*
	if (WindowSize != "")
	{
		WinDetails += "," + WindowSize;
	}
*/		
	BasicWindow = window.open(WindowUrl, WindowTitle, WinDetails);
	BasicWindow.focus();
}//OpenBasicWindow

function ClosePromptWindow()
{
	window.opener.focus();
	window.close();
}//ClosePromptWindow


function OpenToolTip(ToolTipUrl)
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=400,width=550,top=0,left=" + (window.screen.width/2 - 275);
	var ToolTipWindow;
	
	ToolTipWindow = window.open("../Utilities/Sys/ToolTip.aspx?ToolTipUrl=" + ToolTipUrl, "ToolTip", WinDetails);
	ToolTipWindow.focus();

}//OpenToolTip

function OpenShipToSelector()
{
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=450,width=635,top=0,left=" + (window.screen.width/2 - 315);
	var ShipToWindow;
	
	ShipToWindow = window.open("../Utilities/User/ShipToSelector.aspx", "ShipTo", WinDetails);
	ShipToWindow.focus();
}

function PopulateShipTo(Name, Address1, Address2, City, State, Zip)
{
	document.getElementById("txtShipToName").value = Name;
	document.getElementById("txtShipToAddress1").value = Address1;
	document.getElementById("txtShipToAddress2").value = Address2;
	document.getElementById("txtShipToCity").value = City;
	document.getElementById("txtShipToState").value = State;
	document.getElementById("txtShipToZip").value = Zip;
}//PopulateShipTo

function ClearDropDownList(ddlToClear, defaultWidth)
{
	if (!IsNetscape)
		ddlToClear.style.width = defaultWidth;
		
	for (i = ddlToClear.options.length -1; i >= 0; i--)
	{
		ddlToClear.options[i] = null;
	}
}//ClearDropDownList

function SetElementWidth(ElementToSet, Width)
{
	if (!IsNetscape())
		ElementToSet.style.width = Width;
	if (Width == 0 && ElementToSet == NextButton)
		NextButton.disabled = true;
	else
		NextButton.disabled = false;
}

function SetElementValue(ElementToSet, ValueToSet)
{
	if (ValueToSet == null)
		ValueToSet = "";
		
	if (document.getElementById(ElementToSet))
	{
		document.getElementById(ElementToSet).value = ValueToSet;
	}
}//SetElementValue

function GetElementValue(ElementToGet)
{
	if (document.getElementById(ElementToGet))
	{
		return document.getElementById(ElementToGet).value;
	}
	return "";
}//GetElementValue

function SetElementFocus(ElementToFocus)
{
	if (document.getElementById(ElementToFocus))
	{
		document.getElementById(ElementToFocus).focus();
	}
}//SetElementFocus

function SetLabelText(LabelToSet, LabelText)
{
	LabelToSet.innerHTML = LabelText;
}

function IsNetscape()
{
	var AppName = new String(window.navigator.appName);

	if (AppName.toLowerCase().indexOf("netscape") < 0)
		return false;
	return true;
}//IsNetscape

function NavBack()
{
	window.history.go(-1);
}//NavBack

function PostBackInterface(PbCommand)
{
	__doPostBack(PbCommand, "");
}//PostBackInterface

function IsNumeric(StringToValidate, ValidType)
{
	var StringToCheck = new String(StringToValidate);
	var NumericCharacters = new String();
	var CharacterToCheck;

	if (StringToCheck.length == 0) 
		return false;

	switch (ValidType)
	{
		case "int":
			NumericCharacters = "1234567890-";
			break;
		case "posint":
			NumericCharacters = "1234567890";
			break;
		case "posdec":
			NumericCharacters = "1234567890.";
			break;
		default:
			NumericCharacters = "1234567890.-";
			break;
	}
	
	for (i = 0; i < StringToCheck.length; i++)
	{
		CharacterToCheck = StringToCheck.charAt(i);
		if (NumericCharacters.indexOf(CharacterToCheck) == -1)
		{
			return false;
		}
	}
	return true;
}//IsNumeric

function Cmd_SelectFabric(ComControl, PatternControl, ColorControl, WidthControl, RepeatControl)
{
	var ComElement = document.getElementById(ComControl);
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=500,width=700,top=0,left=" + (window.screen.width/2 - 300);
	var FabricSelector;
	var ComValue, AllowDefaultChange, FabricPattern, FabricColor;
	var PatternElement = document.getElementById(PatternControl);
	var ColorElement = document.getElementById(ColorControl);
	
	if (ComElement != null)
		ComValue = ComElement.value;
	else
		ComValue = "NO";

	if (PatternElement != null)
	{
		FabricPattern = PatternElement.value;
		AllowDefaultChange = PatternElement.getAttribute("AllowDefaultChange");
	}
	else
	{
		FabricPattern = "";
		AllowDefaultChange = "True";
	}

	if (ColorElement != null)
	{
		FabricColor = ColorElement.value;
	}
	else
	{
		FabricColor = "";
	}
	
	if (ComValue == "NO")
	{
		FabricSelector = window.open("FabricSelector.aspx?FabricPattern=" + FabricPattern + "&FabricColor=" + FabricColor + "&AllowDefaultChange=" + AllowDefaultChange + "&PatternElement=" + PatternControl + "&ColorElement=" + ColorControl + "&WidthElement=" + WidthControl + "&RepeatElement=" + RepeatControl, "FabricSelector", WinDetails);
		FabricSelector.focus();
	}	
}//Cmd_SelectFabric

function Cmd_SetComState(ComControl, PatternControl, ColorControl, WidthControl, RepeatControl, VendorControl, ComValue)
{
	var PatternElement = document.getElementById(PatternControl);
	var ColorElement = document.getElementById(ColorControl);
	var WidthElement = document.getElementById(WidthControl);
	var RepeatElement = document.getElementById(RepeatControl);
	var VendorElement = document.getElementById(VendorControl);
	var ComFabric = new Boolean();

	ComFabric = (ComValue == "YES");
	if (PatternElement != null)
		PatternElement.readOnly = !ComFabric;
	if (ColorElement != null)
		ColorElement.readOnly = !ComFabric;
	if (WidthElement != null)
		WidthElement.readOnly = !ComFabric;
	if (RepeatElement != null)
		RepeatElement.readOnly = !ComFabric;
	if (VendorElement != null)
	{
		if (ComFabric)
		{
			VendorElement.value = "";
			VendorElement.readOnly = false;
		}
		else
		{
			VendorElement.value = "KASMIR";
			VendorElement.readOnly = true;
		}	
	}
}//Cmd_SetComState
function Cmd_SelectFabric(ComControl, PatternControl, ColorControl, WidthControl, RepeatControl)
{   
	var ComElement = document.getElementById(ComControl);
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=500,width=700,top=0,left=" + (window.screen.width/2 - 300);
	var FabricSelector;
	var ComValue, AllowDefaultChange, FabricPattern, FabricColor;
	var PatternElement = document.getElementById(PatternControl);
	var ColorElement = document.getElementById(ColorControl);
	
	if (ComElement != null)
		ComValue = ComElement.value;
	else
		ComValue = "NO";

	if (PatternElement != null)
	{
		FabricPattern = PatternElement.value;
		AllowDefaultChange = PatternElement.getAttribute("AllowDefaultChange");
	}
	else
	{
		FabricPattern = "";
		AllowDefaultChange = "True";
	}

	if (ColorElement != null)
	{
		FabricColor = ColorElement.value;
	}
	else
	{
		FabricColor = "";
	}
	
	if (ComValue == "NO")
	{
		FabricSelector = window.open("FabricSelector.aspx?FabricPattern=" + FabricPattern + "&FabricColor=" + FabricColor + "&AllowDefaultChange=" + AllowDefaultChange + "&PatternElement=" + PatternControl + "&ColorElement=" + ColorControl + "&WidthElement=" + WidthControl + "&RepeatElement=" + RepeatControl, "FabricSelector", WinDetails);
		FabricSelector.focus();
	}	
}//Cmd_SelectFabric

function Cmd_ColorSelect(ComControl,ddlPatternControl,ddlPatternValue,ColorControl, WidthControl, RepeatControl)//added on 06/30/09
{   
	var ComElement = document.getElementById(ComControl);
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=500,width=700,top=0,left=" + (window.screen.width/2 - 300);
	var FabricSelector;
	var ComValue, AllowDefaultChange, FabricPattern, FabricColor;
	var PatternElement = document.getElementById(ddlPatternControl);
	var ColorElement = document.getElementById(ColorControl);
	
	if (ComElement != null)
		ComValue = ComElement.value;
	else
		ComValue = "NO";

	if (PatternElement != null)
	{   
		FabricPattern = ddlPatternValue ;
		AllowDefaultChange = PatternElement.getAttribute("AllowDefaultChange");
	}
	else
	{
		FabricPattern = "";
		AllowDefaultChange = "True";
	}

	if (ColorElement != null)
	{
		FabricColor = ColorElement.value;
	}
	else
	{
		FabricColor = "";
	}
	
	if (ComValue == "NO")
	{   
	    FabricSelector = window.open("FabricSelector.aspx?FabricPattern=" + FabricPattern + "&FabricColor=" + FabricColor + "&AllowDefaultChange=" + AllowDefaultChange + "&PatternElement=" + ddlPatternControl + "&ColorElement=" + ColorControl + "&WidthElement=" + WidthControl + "&RepeatElement=" + RepeatControl, "FabricSelector", WinDetails);
		FabricSelector.focus();
	}	
}//Cmd_ColorSelect added on 06/30/09

function Cmd_Color(ComControl,ddlPatternControl,ColorControl, WidthControl, RepeatControl)//added on 06/30/09
{  
  
    //var PatternElement = document.getElementById(ddlPatternControl);
    //var FabricPattern = document.getElementById(ddlPatternControl).value;
    //alert("hi this is the value in the ddl for pattern :" + FabricPattern );
    var ComElement = document.getElementById(ComControl);
	var WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=500,width=700,top=0,left=" + (window.screen.width/2 - 300);
	var FabricSelector;
	var ComValue, AllowDefaultChange, FabricPattern, FabricColor;
	var PatternElement = document.getElementById(ddlPatternControl);
	var ColorElement = document.getElementById(ColorControl);
	
	if (ComElement != null)
		ComValue = ComElement.value;
	else
		ComValue = "NO";

	if (PatternElement != null)
	{   
		FabricPattern = document.getElementById(ddlPatternControl).value ;
		AllowDefaultChange = PatternElement.getAttribute("AllowDefaultChange");
	}
	else
	{
		FabricPattern = "";
		AllowDefaultChange = "True";
	}

	if (ColorElement != null)
	{
		FabricColor = ColorElement.value;
	}
	else
	{
		FabricColor = "";
	}
	
	if (ComValue == "NO")
	{   
	    FabricSelector = window.open("FabricSelector.aspx?FabricPattern=" + FabricPattern + "&FabricColor=" + FabricColor + "&AllowDefaultChange=" + AllowDefaultChange + "&PatternElement=" + ddlPatternControl + "&ColorElement=" + ColorControl + "&WidthElement=" + WidthControl + "&RepeatElement=" + RepeatControl, "FabricSelector", WinDetails);
		FabricSelector.focus();
	}	
	
}//Cmd_ColorSelect added on 06/30/09





function Cmd_SetSku(PatternControl, PatternValue, ColorControl, ColorValue, WidthControl, WidthValue, RepeatControl, RepeatValue)
{
	var PatternElement = document.getElementById(PatternControl);
	var ColorElement = document.getElementById(ColorControl);
	var WidthElement = document.getElementById(WidthControl);
	var RepeatElement = document.getElementById(RepeatControl);
	
	if (PatternElement != null)
		PatternElement.value = PatternValue;
	if (ColorElement != null)
		ColorElement.value = ColorValue;
	if (WidthElement != null)
		WidthElement.value = WidthValue;
	if (RepeatElement != null)
		RepeatElement.value = RepeatValue;
}



function Cmd_PillowTuckOnChange(LengthControl, ddlValue)
{
	var ValueString = new String(ddlValue);
	var LengthElement = document.getElementById(LengthControl);
	
	if (ValueString.toLowerCase().replace(" ", "") == "no")
	{
		SetElementValue(LengthControl, "0");
		LengthElement.readOnly = true;
	}
	else
	{
		LengthElement.readOnly = false;
	}
	
}//Cmd_PillowTuckOnChange

function Cmd_CorniceRailRoadOnChange(ddlValue)
{
	var ValueString = new String(ddlValue);
	
	if (ValueString.toLowerCase().replace(" ", "") == "no")
	{
		alert("Please note that selecting NO for Railroad may cause seams to be visible on the finished product.");
	}
}//Cmd_CorniceRailRoadOnChange

function Cmd_ShapeOnChange(ddlValue)
{   
   
	var ValueString = new String(ddlValue);
	
	if (ValueString.toLowerCase()== "oval")
	{
		alert("Order will be held untill drawing is received.");
	}
} //Cmd_ShapeOnChange


function Cmd_PleatedValanceShapeOnChange(ddlValue)
 {
    var ValueString = new String(ddlValue);

    if (ValueString.toLowerCase() == "999") {
        alert("All original design shapes must be quoted. Pattern fees will apply");
    }
} //Cmd_PleatedValanceShapeOnChange



function Cmd_HeadingCasingOnChange(SizeControl, ddlValue)
{
	var ValueString = new String(ddlValue);
	var LengthElement = document.getElementById(SizeControl);
	
	if (ValueString.toLowerCase().replace(" ", "") == "none")
	{
		SetElementValue(SizeControl, "0");
		LengthElement.readOnly = true;
	}
	else
	{
		LengthElement.readOnly = false;
	}
}//Cmd_CasingOnChange

function Cmd_PleatStyleOnChange(FullnessControl, ddlValue)
{
	SetElementValue(FullnessControl, GetValidFullness(ddlValue));	
}//Cmd_PleatStyleOnChange

function Cmd_FullnessOnChange(PleatStyleControl, FullnessValue)
{
    var PleatStyleElement = document.getElementById(PleatStyleControl);
	var ValidFullness;
	var PleatStyle = new String();

	if (document.getElementById(PleatStyleControl))
	{
		PleatStyle = GetElementValue(PleatStyleControl);
		if (PleatStyle.replace(" ", "") != "")
		{
			ValidFullness = GetValidFullness(PleatStyle);
			if (parseFloat(FullnessValue) != parseFloat(ValidFullness))
				alert("The Fullness you selected is not recommended for the Pleat Style " + PleatStyle + ".\nIf you do not select a Fullness of " + ValidFullness + ", seams on your product may be visible.");
		}
	}
}//Cmd_FullnessOnChange

function Cmd_TieDownOnChange(RodFaceControl , TieDownValue)//added for tiedownsize
{  
	var RodFaceElement = document.getElementById(RodFaceControl);
	var RodFaceWidth = new String();

	if (document.getElementById(RodFaceControl))
	{
	   
		RodFaceWidth = GetElementValue(RodFaceControl);
		
		if (RodFaceWidth.replace(" ", "") != "")
		{
			if (parseFloat(TieDownValue) >= parseFloat(RodFaceWidth))
				alert("The TieDownSize is the center of the hourglass and should be smaller than the RodfaceWidth.");
		}
	}
}//Cmd_TieDownOnChange



function GetValidFullness(PleatStyle)
{
	var Pleat = new String(PleatStyle);
	Pleat = Pleat.replace(" ", "");
	
	switch (Pleat)
	{
		case "2FINGER":
		case "CARTRIDGE":
		case "GOBLET":
		case "WINDSOR":
			return "2.0";
		case "3FINGER":
//		case "4FINGER":
		case "BUTTERFLY":
		case "FRENCH":
		case "INVERTED":
			return "2.5";
			//added per Alexis
		case "4FINGER":	
		    return "3.0";
		case "5FINGER":
			return "4.0";//changed to 4 per Alexis
		default:
			return "";
	}
}//GetValidFullness

function Cmd_MountTypeOnChange(MountValue)
{
	if (MountValue == "INSIDE")
		alert("We deduct 1/2\" on Inside Mounting.  Please do not include this deduction in your measurements.");
}//Cmd_MountTypeOnChange

//Custom Made Menu/Expressions Ultra Menu
function OpenProductionSchedule()
{
	OpenBasicWindow("ProductionSchedule.aspx", "ProductionSchedule", 500, 400);
}//OpenProductionSchedule

function OpenTutorial()
{
	var	WindowHeight, WindowWidth, WindowLeft = 0;
	var WinDetails;
	var BasicWindow;
	
	if (IsNetscape())
	{
			WindowHeight = 540;
			WindowWidth = 790;				
	}
	else
	{
		if (window.screen.width <= 800)
		{
			WindowHeight = (window.screen.height - 60);
			WindowWidth = (window.screen.width - 10);				
		}
		else
		{
			WindowLeft = (window.screen.width/2 - 400);
			WindowHeight = 600;
			WindowWidth = 800;				
		}				
	}
	WinDetails = "scrollbars=yes,resizable=yes,toolbar=no,location=no,status=no,menubar=no,height=" + WindowHeight + ",width=" + WindowWidth + ",top=0,left=" + WindowLeft;
	
	BasicWindow = window.open("Tutorial/Start.htm", "ExpressionsTutorial", WinDetails);
	BasicWindow.focus();
}//OpenProductionSchedule

function StartOrder()
{
	PostBackInterface("lnkStartOrder");
	
}//StartOrder

function OpenCellTip(TableId, CellId, ObjectType)
{
	//ObjectType is type of grid element, like cell, as in this case
	
	if(ObjectType == 0) 
	{ 
		igtbl_getElementById(CellId).style.cursor = 'hand';
		var TheCell = igtbl_getCellById(CellId);
		//added for new infragistics control TheCell.MaskedValue did not work
		var CellString = CellId.substring(19);
	    var CellValue = TheCell.Row.getCell(CellString).getValue();
	    	
//		var CellValue = new String(TheCell.MaskedValue);
//		if (CellValue.replace(" ", "") != "")
        if (CellValue != "" || CellValue == "0")
		{
	        
			document.getElementById("CellTipLabel").innerText = CellValue;
			popUp(event, 'CellTipLabel');
		}
	}
}//OpenCellTip

/****  ToolTip Script  ****/
var DH = 0;var an = 0;var al = 0;var ai = 0;if (document.getElementById) {ai = 1; DH = 1;}else {if (document.all) {al = 1; DH = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {an = 1; DH = 1;}}} function fd(oi, wS) {if (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi); if (al) return wS ? document.all[oi].style: document.all[oi]; if (an) return document.layers[oi];}
function pw() {return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;}
function mouseX(evt) {if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); else return null;}
function mouseY(evt) {if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return null;}
function popUp(evt,oi) {if (DH) {var wp = pw(); ds = fd(oi,1); dm = fd(oi,0); st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else {tv = mouseY(evt) + 20; lv = mouseX(evt) - (ew/4); if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2; if (!an) {lv += 'px';tv += 'px';} ds.left = lv; ds.top = tv; ds.visibility = "visible";}}}
/****  End ToolTip Script  ****/


