// ROLL-OVER
function roll(obj, state) {
  if (state == 0) { document.images[obj].src = "/images/everest/btn/" + obj + "_on.gif" };
  if (state == 1) { document.images[obj].src = "/images/everest/btn/" + obj + "_off.gif" };
}

function setState(obj,state) {
	alert("here"+obj)
  if (state == 1) { document.images[obj].src = "/images/everest/btn/" + obj + "_on.gif" };   
}

function pop(url){
	
	newwin = window.open(url,'newwin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=320,height=400,top=50,left=150');

	//if popup blocked load in current window.
	if (newwin == null) {
		//window.location = url;
	}
	//foucs the popup
	newwin.focus(); 

}

		function updateSort(order) {

			var index = document.sortForm.Ns.selectedIndex;

			if(order == null || order == "") {
				document.sortForm.Ns.options[index].value += "|" + document.sortForm.so.value;
			}
			else {
				document.sortForm.Ns.options[index].value +=  "|" + order;
				document.sortForm.so.value = order;
			}

			document.sortForm.submit();
		}
		
			function searchSubmit() {

				document.basicSearchForm.Ntt.value=document.basicSearchForm.Ntt.value.replace(/[\&\#]/g, '');
		if(document.basicSearchForm.Ntt.value != null &&
  	  document.basicSearchForm.Ntt.value != "") {

			//document.basicSearchForm.Ntt.value=document.basicSearchForm.Ntt.value.replace(/[\&\#]/g, '');

			//alert(document.basicSearchForm.Ntt.value);
			document.basicSearchForm.D.value = document.basicSearchForm.Ntt.value;
			return true;
		}
		return false;
	}  
	
	function myMoodSubmit() {
		var n = "";
		n = document.myMoodForm.moods.options[document.myMoodForm.moods.selectedIndex].value;
		n += " " + document.myMoodForm.runningTime.options[document.myMoodForm.runningTime.selectedIndex].value;
  		document.myMoodForm.N.value = n;
		//alert("n : "   + document.myMoodForm.N.value);	
		return true;
	} 
	
// Safari 2.0.. detection

function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 
   var browserVer=parseInt(navigator.appVersion);

   // browser name   
   this.isSafari      = (ua.indexOf('safari') != - 1);
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // version number
   if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   }
   else {
      this.versionMinor = "";
   }   
   this.versionMajor = parseInt(this.versionMinor); 

   // platform
   this.isMac    = (ua.indexOf('mac') != -1);
   
   if (this.isMac && this.isSafari && browserVer>=2) {
   		document.write("<style>");
		document.write("#expandable_label div {");
		document.write("background:url(/images/everest/layout/left_slider.gif) no-repeat left bottom;");
		document.write("padding: 6px 15px 6px 15px;");
		document.write("margin: 0; border: 0;");
		document.write("line-height: 12px;");
		document.write("}");
		
		document.write("TABLE.lrg_box_gray_top #expandable_label div {");
		document.write("background:url(/images/everest/layout/left_slider.gif) no-repeat left bottom;");
		document.write("margin: 0; border: 0;");
		document.write("line-height: 12px;");
		document.write("}");									
		
		document.write("</style>");
   }
   
}
var browser = new BrowserDetect();

