
//date function
RightNow=new Date();
var themonth;
var ModelIsFocus;
var PartIsFocus;
var EmailFocus=false;
var SearchFocus=false;
var DefSearchFocus=false;

var month=RightNow.getMonth()+1;
if (month==1) themonth = "January";
if (month==2) themonth = "February";
if (month==3) themonth = "March";
if (month==4) themonth = "April";
if (month==5) themonth = "May";
if (month==6) themonth = "June";
if (month==7) themonth = "July";
if (month==8) themonth = "August";
if (month==9) themonth = "September";
if (month==10) themonth = "October";
if (month==11) themonth = "November";
if (month==12) themonth = "December";

var date=RightNow.getDate();
var year=RightNow.getYear();
var day=RightNow.getDay();
if (year==100){year="2000";}
if (year==101){year="2001";}
if (year==102){year="2002";}
if (year==103){year="2003";}
if (year==104){year="2004";}
if (year==105){year="2005";}

	function newWin(name, url, width, height, args) {
		var newWin = new Object();

		newWin.args = args;
		newWin.url = url;
		newWin.name = name;
		newWin.width = width;
		newWin.height = height;

		if (document.layers) {// browser is NN
			newWin.left = window.screenX + ((window.outerWidth - newWin.width) / 2);
			newWin.top = window.screenY + ((window.outerHeight - newWin.height) / 2);
			var attr = 'screenX=' + newWin.left + ',screenY=' + newWin.top + ',width=' + newWin.width + ',height=' + newWin.height + ',' + newWin.args;
		}
		else {// browser is MSIE
			newWin.left = (screen.width - newWin.width) / 2;
			newWin.top = (screen.height - newWin.height) / 2;
			var attr = 'left=' + newWin.left + ',top=' + newWin.top + ',resizable=yes,width=' + newWin.width + ',height=' + newWin.height + ',' + newWin.args;
		}

		newWin.win=window.open(newWin.url, newWin.name, attr);
		newWin.win.opener=self;
		newWin.win.focus();
	}
	
	function CheckFrameParent()
	{
		var redirectUrl;
		var midUrl;
		var imgNum; 				
		if (top.location.href.indexOf("ModelFrames") < 0){			
			redirectUrl = top.location.href;			
			midUrl = top.location.href;			
			midUrl = midUrl.substring(midUrl.indexOf("//")+2, midUrl.length);				
			midUrl = midUrl.substring(midUrl.indexOf("/")+1, midUrl.indexOf(".aspx"));			
			redirectUrl = redirectUrl.substring(0,redirectUrl.indexOf("&Mark"));				
			redirectUrl = redirectUrl.replace(midUrl,"ModelFrames");			
			midUrl = top.location.href;				
			midUrl = midUrl.substring(midUrl.indexOf("&Mark")+6, midUrl.indexOf("&Mark")+7);				
			redirectUrl = redirectUrl + "&Mark=" + midUrl;			
			top.location.href = redirectUrl ; // top.location.href.replace("PartLists","ModelFrames");			
			//top.location.href = top.location.href.substring(0, top.location.href.indexof("Type"));
		}
	//	if(self.location.href.indexOf("PartLists") > 0)
	//	{
	//		top.contents.location.replace("/FrameImgList.aspx?ModelID=145798&ModelNum=lat1000gge&ManufactureID=1&Selected=LW13-17&Position=0&mfg=Maytag&Type=Appliance#5");
	//	}
		
	}
	
	//Added on Dec 31, 2003 for combining the search boxes
//	function keyPress(key)
//	{
//		if (key == '13'&& (EmailFocus == true || SearchFocus == true || DefSearchFocus == true))
//		{
//			if(EmailFocus == true)
//			{				
//				document.getElementById('infobar_btn_Submit').focus();										
//			}
//			else if(SearchFocus == true)
//			{
//				document.getElementById('menu_SearchButton').focus();
//			//	document.getElementById('menu_SearchButton').click();
//			}
//			else if(DefSearchFocus == true)
//			{
//				document.getElementById('ImageButton1').focus();
//			//	document.getElementById('ImageButton1').click();				
//			}			
//		}
//		else if(key == '13')
//		{
//			document.getElementById('ImageButton1').focus();
//		}
//	}
	
	function Email_OnClick()
	{
		if(navigator.appName != "Netscape"){				
			EmailFocus = true;
			SearchFocus = false;			
		}
	}
	function Search_OnClick()
	{
		if(navigator.appName != "Netscape"){				
			EmailFocus = false;
			SearchFocus = true;			
		}
	}
	function DefModelSearch_OnClick()
	{
		if(navigator.appName != "Netscape"){				
			EmailFocus = false;
			DefSearchFocus = true;			
		}
	}
	function displayDefinition()
	{		
		var definition;	
		var PartType = document.aspnetForm._ctl0_PageContent_PartType;
		definition = PartType.options[PartType.selectedIndex].value;		
		if (definition.length == 0)
		{			
			document.getElementById("txt_ExpandedDef").innerHTML = "";
		}
		else 
		{				
			document.getElementById("txt_ExpandedDef").innerHTML = "<span class=\"ExpandedTitle\">Expanded Definition:</span><br /><span class=\"ExpandedDefinition\">" 
			+ definition + "</span>";
		}
	}
	
	function val_msg()
	{
			return true;
	}	
