function popupWin() {
   newWindow = window.open('/popup.htm','newWin','width=300,height=200');
  // setTimeout('windowProp(text)', 3000); 		// delay 3 seconds before opening
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




   function callURL()
   {
	window.parent.window.parent.location.href = "/myetopia.html";
   }
   
   
   function openwin(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=710,height=455,left=' + myLeft + ',top= ' + myTop
		
		window.open( link,'', myFeatures);
	}
	
	
	
	function openCalPopWin(formName, element) {
		openWinSize('/office/calendar/calpop.asp?FormName=' + formName + '&Element=' + element, 230, 225);
		return false;
	}

	function openWinSize(link, width, height) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 760) / 2) > 0) {
			myLeft = ((screen.width - 760) / 2) + 450
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 500) / 2) > 0) {
			myTop = ((screen.height - 500) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height;

		window.open( link,'', myFeatures);
	}
   
  function OpenWinCenter(link, width, height) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		myLeft=(screen.width)/2-width/2;
		myTop=(screen.height )/2-height/2;
		myFeatures = 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,left='+myLeft+', top='+myTop+',scrollbars=yes,resizable=yes,width=' + width + ',height=' + height;
        window_handle=window.open(link,'newwindow',myFeatures);
        window_handle=window_handle.focus();
        return true;
  }
  
  //popup small window without anything
  
  function PopUpWin(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		var width=480
		var height=450
		myLeft=(screen.width)/2-width/2;
		myFeatures = 'resizable=no, scrollbars=no,toolbar=no,location=no, directories=no,status=no,menubar=no,left='+myLeft+', top='+myTop+',width=' + width + ',height=' + height;
        window_handle=window.open(link,'newwindow',myFeatures);
        window_handle=window_handle.focus();
        return true;
  }
  
 //popup small window without anything
  
  function PopUpWin1(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		var width=480
		var height=500
		myLeft=(screen.width)/2-width/2;
		myFeatures = 'resizable=yes, scrollbars=yes,toolbar=no,location=no, directories=no,status=no,menubar=no,left='+myLeft+', top='+myTop+',width=' + width + ',height=' + height;
        window_handle=window.open(link,'newwindow',myFeatures);
        window_handle=window_handle.focus();
        return true;
  }
  
  //popup email window without anything
  
  function PopUpEmail(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		var width=480
		var height=310
		myLeft=(screen.width)/2-width/2;
		myFeatures = 'resizable=no, scrollbars=no,toolbar=no,location=no, directories=no,status=no,menubar=no,left='+myLeft+', top='+myTop+',width=' + width + ',height=' + height;
        window_handle=window.open(link,'newwindow',myFeatures);
        window_handle=window_handle.focus();
        return true;
  }

   function openSmallWin(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=yes,location=yes,directories=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=650,height=480,left=' + myLeft + ',top= ' + myTop
		
		window.open( link,'', myFeatures);
	}
	
	function openSmallWin1(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=580,left=' + myLeft + ',top= ' + myTop
		
		window.open( link,'', myFeatures);
	}
	
	 function openSmallWinStatus(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=825,height=500,left=' + myLeft + ',top= ' + myTop
		
		window.open( link,'', myFeatures);
	}
	
	   function openLink(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=450,left=' + myLeft + ',top= ' + myTop
		
		window.open( link,'level2Win', myFeatures);
	}


	   function openContactManager1(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=220,height=350,left=' + myLeft + ',top= ' + myTop
		
		window.open( link,'', myFeatures);
	}
	
		
	
   function openSearchWin(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures
		if (((screen.width - 790) / 2) > 0) {
			myLeft = ((screen.width - 760) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 500) / 2) > 0) {
			myTop = ((screen.height - 500) / 2)
		}
		else {
			myTop = 0
		}
		myFeatures = 'toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=790,height=500,left=' + myLeft + ',top= ' + myTop	
		window.open( link,'level2Win', myFeatures);
	}

   function processForm(formName, formName2) {
	switch (formName)
	{
		case "Google":
			var SearchString = "http://www.google.com/search?q=" + formName2;
			//top.framename.location=SearchString;
			myframehdr="yes";
			openSearchWin(SearchString);
			break;
		case "Yahoo":
			var SearchString = "http://search.yahoo.com/bin/search?p=" + formName2;
			//top.framename.location=SearchString;
			myframehdr="yes";
			openSearchWin(SearchString);
			break;
		case "Excite":
			var SearchString = "http://search.excite.com/search.gw?c=web&search=" + formName2;
			//top.framename.location=SearchString;
			myframehdr="yes";
			openSearchWin(SearchString);
			break;
		case "Alta Vista":
			var SearchString = "http://www.altavista.com/sites/search/web?q=" + formName2;
			//top.framename.location=SearchString;
			myframehdr="yes";
			openSearchWin(SearchString);
			break;
		case "News":
			var SearchString = "http://myetopia.yellowbrix.com/pages/myetopia/Search.nsp?srStart=1&srQuery=" + "'" + formName2 + "'" + "&ID=myetopia&scategory='AP+Top+Headlines'";
			myframehdr="no";
			openSearchWin(SearchString);
			break;
		case "People":
			var SearchString = "http://myetopia.yellowbrix.com/pages/myetopia/PeopleSearch.nsp?start=1&srQuery=" + "'" + formName2 + "'" + "&ID=myetopia&tickerlist=&scategory=AP+Top+Headlines";
			myframehdr="no";
			openSearchWin(SearchString);
			break;
		case "Stocks":
			var myname = formName2
			var mylength = myname.length
			if (mylength > 4) {
				var SearchString = "http://myetopia.yellowbrix.com/pages/myetopia/coQuote.nsp?quoteLookup=1&by name=" + formName2 + "&byNameTicker=name&id=myetopia"
			}		
			else {
				var SearchString = "http://myetopia.yellowbrix.com/pages/myetopia/coQuote.nsp?quoteLookup=1&by name=" + formName2 + "&byNameTicker=ticker&id=myetopia"
			}
			myframehdr="no";
			openSearchWin(SearchString);
			break;
		case "Companies":
			var SearchString = "http://myetopia.yellowbrix.com/pages/myetopia/coOverview.nsp?found=1&by_name=" + formName2 + "&ID=myetopia&tickerlist=&scategory=AP+Top+Headlines&x=16&y=8";
			myframehdr="no";
			openSearchWin(SearchString);
			break;
		case "Learning Center":
			var SearchString = "/Applications/LearningCenter/query.asp?qu=" + formName2 + "&sc=/Applications/LearningCenter&RankBase=1000";
			myframehdr="no";
			openSearchWin(SearchString);
			break;
		default:
			alert("Sorry, not yet available.");
			break;
	}
   }
   
   function setMouseOver(txt)
	{
		window.status = txt;
		return true;
	}

	function clearMouseOver()
	{
		window.status='';
		return true;
	}

	function openTinyWin(link) {
		var myLeft = 0
		var myTop = 0
		var myFeatures

		if (((screen.width - 700) / 2) > 0) {
			myLeft = ((screen.width - 700) / 2)
		}
		else {
			myLeft = 0
		}
		if (((screen.height - 450) / 2) > 0) {
			myTop = ((screen.height - 450) / 2)
		}
		else {
			myTop = 0
		}

		myFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=330,left=' + myLeft + ',top= ' + myTop

		window.open( link,'', myFeatures);
		
	}
	
	function checkdate(objName) {
		var datefield = objName;
		if (chkdate(objName) == false) {
			datefield.select();
			alert("Invalid date!");
			datefield.focus();
			return false;
			}
		else {
			return true;
			}
	}
	
	
	
	function chkdate(objName) {
		var strDatestyle = "US"; //United States date style
		//var strDatestyle = "EU";  //European date style
		var strDate;
		var strDateArray;
		var strDay;
		var strMonth;
		var strYear;
		var intday;
		var intMonth;
		var intYear;
		var booFound = false;
		var datefield = objName;
		var strSeparatorArray = new Array("-"," ","/",".");
		var intElementNr;
		var err = 0;
		var strMonthArray = new Array(12);
		strMonthArray[0] = "Jan";
		strMonthArray[1] = "Feb";
		strMonthArray[2] = "Mar";
		strMonthArray[3] = "Apr";
		strMonthArray[4] = "May";
		strMonthArray[5] = "Jun";
		strMonthArray[6] = "Jul";
		strMonthArray[7] = "Aug";
		strMonthArray[8] = "Sep";
		strMonthArray[9] = "Oct";
		strMonthArray[10] = "Nov";
		strMonthArray[11] = "Dec";
		strDate = datefield.value;
		if (strDate.length < 1) {
		return true;
	}
	
		for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
		if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
		strDateArray = strDate.split(strSeparatorArray[intElementNr]);
		if (strDateArray.length != 3) {
		err = 1;
		return false;
		}
		else {
		strDay = strDateArray[0];
		strMonth = strDateArray[1];
		strYear = strDateArray[2];
		}
		booFound = true;
		 }
		}
		if (booFound == false) {
		if (strDate.length>5) {
		strDay = strDate.substr(0, 2);
		strMonth = strDate.substr(2, 2);
		strYear = strDate.substr(4);
		}
		}
		if (strYear.length == 2) {
		strYear = '20' + strYear;
		}
		// US style
		if (strDatestyle == "US") {
		strTemp = strDay;
		strDay = strMonth;
		strMonth = strTemp;
		}
		intday = parseInt(strDay, 10);
		if (isNaN(intday)) {
		err = 2;
		return false;
		}
		intMonth = parseInt(strMonth, 10);
			if (isNaN(intMonth)) {
		for (i = 0;i<12;i++) {
		if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
		intMonth = i+1;
		strMonth = strMonthArray[i];
		i = 12;
		 }
		}
		if (isNaN(intMonth)) {
		err = 3;
		return false;
		}
		}
		
		if ( isNaN(Number(strYear,10))) {
		    //alert("Here");
			err=100;
		  return false;
		}
		
		intYear = parseInt(strYear, 10);
		//alert(Number(strYear,10));
		if (isNaN(intYear)) {
		err = 4;
		return false;
		}
		if (intMonth>12 || intMonth<1) {
		err = 5;
		return false;
		}
		if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
		err = 6;
		return false;
		}
		if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
		err = 7;
		return false;
		}
		if (intMonth == 2) {
		if (intday < 1) {
		err = 8;
		return false;
		}
		if (LeapYear(intYear) == true) {
		if (intday > 29) {
		err = 9;
		return false;
		}
		}
		else {
		if (intday > 28) {
		err = 10;
		return false;
		}
		}
		}
		if (strDatestyle == "US") {
		//datefield.value = strMonthArray[intMonth-1] + " " + intday+" " + strYear;
		}
		else {
		//datefield.value = intday + " " + strMonthArray[intMonth-1] + " " + strYear;
		}
		return true;
		}
		function LeapYear(intYear) {
		if (intYear % 100 == 0) {
		if (intYear % 400 == 0) { return true; }
		}
		else {
		if ((intYear % 4) == 0) { return true; }
		}
		return false;
		}
		function doDateCheck(from, to) {
		if (Date.parse(from.value) <= Date.parse(to.value)) {
		alert("The dates are valid.");
		}
		else {
		if (from.value == "" || to.value == "") 
		alert("Both dates must be entered.");
		else 
		alert("To date must occur after the from date.");
		}
	}


  function supressError() {
    return true;
  }

  function load(url) {
    window.onerror = supressError;
    opener.location.href = url;
    setTimeout('self.close()',1000);
  }
  
  function OpenVideoSmallClip(link)	{
	openWinVideo( link, 192, 144 );
  }
   
  function OpenVideoLargeClip(link)	{
	openWinVideo( link, 320, 240 );
  }


  function openWinVideo(link, width, height) {
 	var myLeft = 0
 	var myTop = 0
 	var myFeatures
 	if (((screen.width - 700) / 2) > 0) {
 		myLeft = ((screen.width - 700) / 2)
 	}
 	else {
 		myLeft = 0
 	}
 	if (((screen.height - 450) / 2) > 0) {
 		myTop = ((screen.height - 450) / 2)
 	}
 	else {
 		myTop = 0
 	}
 	myFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=' + width + ',height=' + height + ',left=' + myLeft + ',top= ' + myTop
		
 	window.open( link,'', myFeatures);
 }
 
 
function addbookmark()
{
bookmarkurl="http://www.seespotride.com"
bookmarktitle="SeeSpotRide-The best dog site"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
	
	