 
	 function msieversion()
		// return Microsoft Internet Explorer (major)
		// version number, or 0 for others.
		// This function works by finding the "MSIE "
		// string and extracting the version number
		// following the space, up to the decimal point
		// for the minor version, which is ignored.
		{
		var ua = window.navigator.userAgent
		var msie = ua.indexOf ( "MSIE " )
		
		if ( msie > 0 )      // is Microsoft Internet Explorer; return version number
			return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) )
		else
			return 0          // is other browser
		}
	 
	 function topelement(sid, nTotal) {
      if (document.getElementById(sid) != null) {
	   nTotal = nTotal + document.getElementById(sid).offsetLeft;
	   topelement(document.getElementById(sid).parentElement.id,nTotal);
      }
    }

	 function showSubMenu(sid, spid){
	   
		 
	     document.getElementById(sid).style.visibility = "visible"
	     document.getElementById(sid).style.position = "absolute"
	     document.getElementById(spid).style.backgroundColor = "red"    

	    
	    // set width of submenu
	    if (document.getElementById(spid).offsetWidth >  document.getElementById(sid).offsetWidth) {
	     
	      document.getElementById(sid + "_table").style.width = document.getElementById(spid).offsetWidth

	    }
	    
		// set top postion
	//	if ( msieversion() > 0 ) 
	//	{
	//	document.getElementById(sid).style.posTop = document.getElementById(spid).offsetTop + document.getElementById(spid).offsetHeight + 1
	//	}
	//	else
	//	{
	     document.getElementById(sid).style.top = document.getElementById(spid).offsetTop + document.getElementById(spid).offsetHeight + 1
	//	}

		
		// set left position
	   if (document.getElementById('centeranchor') != null) {
	//        document.getElementById(sid).style.Posleft = document.getElementById(spid).offsetLeft +  document.getElementById('centeranchor').offsetLeft;
	      document.getElementById(sid).style.left = document.getElementById(spid).offsetLeft +  document.getElementById('centeranchor').offsetLeft;
	   }
	    
	   if (document.getElementById('centeranchor') == null) {   
  	  //      document.getElementById(sid).style.Posleft = document.getElementById(spid).offsetLeft
  	  document.getElementById(sid).style.left = document.getElementById(spid).offsetLeft
	   }
	 }
	 function hideSubMenu(sid, sColor, sDiv){
	    // char[100] nLeft;
	     
		// nLeft = document.activeElement.style.posLeft
	    
	    // set highlight color???
	    document.getElementById(sid).style.backgroundColor = sColor
	     
	    
	    //document.getElementById(sDiv).style.visibility = "hidden"
	    
	 }
	
	function wizardaction(nAction)
	{
		var nAction2, nPageID;
		
		nAction2 = document.getElementById('cbWizard').value
		nPageID = document.getElementById('efPageID').value
	//	alert('wizard action: ' + nAction2);
		window.location = "wizardaction.aspx?action=" + nAction2 + "&rtnPage=" + nPageID
		
	} 
	function headingout(sid, sDivID, sColor)
	{
		
	    document.getElementById(sid).style.backgroundColor = sColor;
		divover(sDivID)
	} 
	
	function divover(sDivID, sID){
	  
	
	   // if the mouse is to the left of the div
	   if ((event.x - 10) < document.getElementById(sDivID).style.posLeft) {
		  document.getElementById(sDivID).style.visibility = "hidden"
		 
	      return;
	   }
	   
	  
	   	// if the mouse is to the right of the div
	    if ((event.x) > (document.getElementById(sDivID).style.posLeft + document.getElementById(sDivID).offsetWidth)) {
	      
	      document.getElementById(sDivID).style.visibility = "hidden"
	      return;
	   }
	   
	   // if the mouse is below the div
	   
	
	    if ((event.y) > (document.getElementById(sDivID).style.posTop + document.getElementById(sDivID).offsetHeight)) {
	  
	    document.getElementById(sDivID).style.visibility = "hidden"
	    
	      return;
	    }
	      
	    // top menu bar moving to the right
	//    if ( (event.y < document.getElementById(sDivID).style.posTop) && (event.x > (document.getElementById(sid).style.width + document.getElementById(sid).offsetLeft))) {
	
		// if the mouse is above the div
	    if  (event.y < document.getElementById(sDivID).style.posTop) {
	     
	        document.getElementById(sDivID).style.visibility = "hidden"
	      return;
	    }
	 }
	 

	

function mywopenwindow (targurl) {
  /* Check for existence of sidebars object. If non-existent, then create it */

  var tempref = window.open(targurl);
}
	
function makewin (targurl, width, height, winopts) {
  /* Check for existence of sidebars object. If non-existent, then create it */
  if (window.sidebars == null) {
    sidebars = new Object;
    sidebars.length = 1;
  }
  allopts = "width=" + width + ",height=" + height + "," + winopts;
  /* Create the new window and update the sidebars array object */
  var tempref = window.open(targurl, "sidebar" + sidebars.length, allopts);

  sidebars[sidebars.length] = tempref;
  sidebars.length++;
}

function makewinmodal (targurl, width, height, winopts) {

 var r = window.showModalDialog(targurl, "hello", 'dialogWidth:670px;dialogHeight:400px;center:1;scroll:0;status:0;'); 
 if (typeof r != "undefined")
   alert(r)
}

function btnExpand_onclick(rowID, btnID, sColor) {
	// show or hide gadget options
	
	if (document.getElementById(btnID).title == "expand")
	{
	// show it
	document.getElementById(btnID).src = "fwimages/collapse" + sColor + ".gif"
	document.getElementById(rowID).style.display = "block"
	document.getElementById(btnID).title = "collapse"
	}
	else
	{
	// hide it
	document.getElementById(btnID).src = "fwimages/expand" + sColor + ".gif"
	document.getElementById(rowID).style.display = "none"
	
	document.getElementById(btnID).title = "expand"
	}
}




function fillfields(sID, sRowID, sIDField, sSelField)
{
	// fill in form fields based on selected tree item
	document.getElementById(sIDField).value = sID
	
	
	if (document.getElementById(sSelField).value != "")
	{
		sSelectedField = document.getElementById(sSelField).value
		sSelectedField = 'selrow' + sSelectedField
		document.getElementById(sSelectedField).className = "adminTreeNotSelected"
	}
	
	
	// highlight the row in the table
	document.getElementById('selrow' + sRowID).className = "adminTreeSelected"
	
	// mark row as highlighted
	document.getElementById(sSelField).value = sRowID


}


function check_number(sValField){

var anum=/(^\d+$)/

sVal = document.getElementById(sValField).value
if (anum.test(sVal)) 
{
	testresult=true
}
else
{
	alert("Please enter a valid number")
	testresult=false
}
return (testresult)
}



// PAYPAL REQUIRED SCRIPTS

function qty_onchange() {
checknumber(document.getElementById('qty').value)

}

function checknumber(sVal){

nMax = document.getElementById('maxqty').value
var anum=/(^\d+$)/
if (anum.test(sVal)) {
	testresult=true
	
	sNum = parseInt(sVal)
	if ((sNum > nMax) || (sNum == 0)) {
		 alert('Please enter a quantity between 1 and ' + nMax)
                 testresult=false
	 }
}
else{
alert("Please enter a valid number")
testresult=false
}
return (testresult)
}

function btnOrder_onclick() {
  
//  if (checknumber(document.getElementById('qty').value) == true) {

        document.getElementById('quantity').value = document.getElementById('qty').value
         document.getElementById('custom').value = document.getElementById('qty').value
        document.getElementById('Form1').action = "https://www.paypal.com/cgi-bin/webscr"
        document.getElementById('Form1').submit()
	//window.navigate('pporder.aspx?qty=' + document.getElementById('qty').value)
//	}
}



function checkout() {
	// make sure cart is not empty
	if (document.getElementById('efTotalPrice').value == 0)
	{
		alert('Your shopping cart is empty')
		return
	}

    document.getElementById('Form1').action = "checkoutlogic.aspx"
    document.getElementById('Form1').submit()
}


function printcart() {
	
	window.open('cart.aspx?mode=print')
}

function paypal_submit() {
        document.getElementById('Form1').action = "https://www.paypal.com/cgi-bin/webscr"
        document.getElementById('Form1').target = "paypal"
        document.getElementById('Form1').submit()
}


function savegallery(galleryid) {
	var sVal

    document.getElementById('Form1').action = "savegallerylogic.aspx"
    document.getElementById('Form1').submit()

}


function execsearch(sSearchField) {
	var sVal
	
	if (document.getElementById(sSearchField) != null) {
	
		sVal = document.getElementById(sSearchField).value
		window.location = 'search.aspx?term=' + sVal
	}
}

function execregistrarsearch(sDomainField, sTLDField, sParamsField) {
	var sVal, sTLD, sPar, sLoc
	
	if (document.getElementById(sDomainField) != null) {
	
		sVal = document.getElementById(sDomainField).value
		sTLD = document.getElementById(sTLDField).value
		sPar = document.getElementById(sParamsField).value
		
		sLoc  = 'checkregistrarlogic.aspx?sld=' + sVal + '&tld=' + sTLD
		
		if (sPar != "") 
		{
			sLoc = sLoc + "&" + sPar
		}
		window.location	= sLoc
	}
}

function searchover() {
  // on mouse over search button
  document.getElementById("imgSearchBtn").src = "fwimages/go_over.gif"
}
function searchout() {
  // on mouse over search button
  document.getElementById("imgSearchBtn").src = "fwimages/go.gif"
}

function logingadget_onclick() {
   
        document.getElementById('Form1').action = "loginlogic.aspx"
      document.getElementById('Form1').submit()
}

// END OF PAYPAL REQUIRED SCRIPTS
	