<!--

//Disable right mouse click Script

var message="Right Click Not Allowed On This Site!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 


function show(id, id2) {
	  showmenu(id);
	  if ( id != id2 ){
	    hidemenu(id2);
	  }
 } 
function showmenu(id) {
	  if (document.getElementById) {
	      if ( document.getElementById(id) ){  
		    document.getElementById(id).style.display="block";
		  }
		} else if (document.all) {
		  document.all[id].style.display="block";
		} else if (document.layers) {
		  document.layers[id].display="block";
		}	   
 }
 
 function hide(id , id2) {
    if ( id != id2 ){    
        hidemenu(id);
	}
	show(id2);
} 

function hidemenu(id) {      
    try{
	  if (document.getElementById) {
	      if ( document.getElementById(id) ){
		    document.getElementById(id).style.display="none";
		  }
		} else if (document.all) {
		  document.all[id].style.display="none";
		} else if (document.layers) {
		  document.layers[id].display="none";
		} 
	} catch(e) {
	    //alert(id);
	}
} 
 
 

function init()
 {
    // quit if this function has already been called
    if (arguments.callee.done) return;
    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;
    // kill the timer
    if (_timer) clearInterval(_timer);
	
    // do stuff	    
	prepareForms();
}

/* for Mozilla/Opera9 */
if (document.addEventListener)
 {
    document.addEventListener("DOMContentLoaded", init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
    document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
    var script = document.getElementById("__ie_onload");
    script.onreadystatechange = function() {
        if (this.readyState == "complete") {
            init(); // call the onload handler
        }
    };
/*@end @*/

/* for Safari */
if (/KHTML|WebKit/i.test(navigator.userAgent)) 
{ // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            init(); // call the onload handler
        }
    }, 10);
}

/* for other browsers */
window.onload = init;

String.prototype.trim = function()
 {
	// Strip leading and trailing white-space
	return this.replace(/^\s*|\s*$/g, "");
}

String.prototype.normalize_space = function()
 {
	// Replace repeated spaces, newlines and tabs with a single space
	return this.replace(/^\s*|\s(?=\s)|\s*$/g, "");
}


function insertAfter(newElement,targetElement)
 {
  var parent = targetElement.parentNode;
  if (parent.lastChild == targetElement)
   {
    parent.appendChild(newElement);
  } else {
    parent.insertBefore(newElement,targetElement.nextSibling);
  }
}

function addClass(element, className)
 {
	if (!hasClass(element, className))
	 {
		if (element.className) element.className += " " + className;
		else element.className = className;
	}
}

function removeClass(element, className)
 {
	var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)");
	element.className = element.className.replace(regexp, "$2");
}

function hasClass(element, className)
 {
	var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)");
	return regexp.test(element.className);
}

function focusLabels()
 {
	if (!document.getElementsByTagName) return false;
	var labels = document.getElementsByTagName("label");
		for (var i=0; i<labels.length; i++)
		 {
		    labels[i].onclick = function() {
			    if(this.getAttribute("for"))
			     {
				       var id = this.getAttribute("for");
				       if (!document.getElementById(id)) return false;
				       var element = document.getElementById(id);
			     }
			     else
			     {
				       if (!this.getElementsByTagName("input")) return false;
				       var element = this.getElementsByTagName("input")[0];				
			     }
			    element.focus();
		 }
	}
}

function resetFields(whichform)
 {
  var inputs = whichform.getElementsByTagName("input");  
  for (var i=0, len=inputs.length; i<len; i++)
   {
	var input = inputs[i];
    if (input.type == "submit" || input.type == "button" || input.type == "reset" || input.type == "image" || input.type == "checkbox" || input.type == "hidden") continue;
    //if (!input.defaultValue) continue;
    //if (!input.defaultValue) input.defaultValue = input.value;
    input.onfocus = function() {
    if (this.value == this.defaultValue) {
      this.select(this.value.length);
     }
    }
    input.onblur = function() {
      if (this.value == "") {
        //this.value = this.defaultValue;
      }
    }
  }
}
// Modified by Savio Fernandes on Aug 17, 2006.
function validateForm(whichform)
 {
    
    var validate = new Object();
    for (var i=0; i<whichform.elements.length; i++)
    {
        var element = whichform.elements[i];
        if (element.className.indexOf("required") != -1)
        {
            if (!isFilled(element))
            {
	            var elTitle = element.title || element.name;
	            alert("Please fill in the "+elTitle+" field.");
	            element.value = trimString(element.value);
	            element.focus();
                return false;
            }
            element.value = trimString(element.value);
        }
        
        
        if(element.className.indexOf("checkstate") != -1)
        {
            if (document.EditShipping.strShippingAddress_country.value =="United States" && element.value=="")
            {
                    var elTitle = element.title || element.name;
                    if (document.EditShipping.strShippingAddress_state_inter.value == "")
                    {               
	                      alert("Please fill in the "+elTitle+" field.");
	                      element.focus();
                          return false;
                    }
                    else
                    {
                        document.EditShipping.strShippingAddress_state.value = document.EditShipping.strShippingAddress_state_inter.value;
                    }
             }
             else
             {
                    document.EditShipping.strShippingAddress_state.value = document.EditShipping.strShippingAddress_state_local.value;
             }
         }
        
    
        if (element.className.indexOf("changedefault") != -1)
        {
    	    if (element.value == element.defaultValue )
    	    {
    		    var elTitle = element.title || element.name;
        	    alert("Please fill in the "+elTitle+" field.");
        	    element.value = "";
        	    element.focus();
        	    return false;	
            }    
        }
        
        if (element.className.indexOf("email") != -1)
        {
            if (!isEmail(element))
            {
		        var elTitle = element.title || element.name;
                alert("The "+elTitle+" field must be a valid email address.");
                element.focus();
                return false;
            }
        }
        //Added one more class as drop down which for now allows more than 1 selected index values to pass through.
        //Hardik Dave on 1st Feb, 07
        if (element.className.indexOf("dropdown") != -1)
        {   
            if (element.value=="")
            {
		        var elTitle = element.title || element.name;
                alert("The "+elTitle+" field must be selected.");
                element.focus();
                return false;
            }
        }
        if (element.className.indexOf("checkusername") != -1 )
        {
            var strtemp = trimString(element.value);
          if ( !isFilled(element) || (strtemp.length < 6 ) || (strtemp.length > 30 ))
          {
                var elTitle = element.title || element.name;
        	    alert("The "+elTitle+" field must be at least 6 - 30 characters in length.");        	    
        	    element.value = trimString(element.value);
        	    element.focus();
        	    return false;	
          }
          element.value = trimString(element.value);
        }
        
        if (element.className.indexOf("password") != -1)
         {
         
            if (!isFullPassword(element))
             {
		        var elTitle = element.title || element.name;
                alert("The "+elTitle+" field must be at least 6 - 20 characters in length.");
                element.focus();
                return false;
             }/*
             else
              {*/
		    if (!hasClass(element,"confirmpass")) validate.password = element.value;
	          /*}*/
            /* Doesn't work, didn't really spend much time on it*/
	        if (!isValidPassword(element))
	         {
	                var elTitle = element.title || element.name;
                    alert("The "+elTitle+" field contains invalid characters.");
                    element.focus();
                    return false;
            }
        }
        
        if (element.className.indexOf("confirmpass") != -1)
         {
            if (!validate.password || validate.password && (element.value != validate.password))
            {
                alert("The passwords you entered don't match.");
                element.focus();
                return false;
            }
         }        
    }
  return true;
}

function isFilled(field) {
 
  if (field.type == "checkbox") {
  	if (!field.checked)
  		return false;
	else
		return true;
	
  }
  else {
      var strtemp = trimString(field.value);
	  if (strtemp.length < 1) { // || field.value == field.defaultValue
	    return false;
	  } else {
	    return true;
	  }
  }	  
}

function isEmail(field)
 {
  var regexpEmail = /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/;
  return regexpEmail.test(field.value);
}

function isFullPassword(field) {
  if (field.value.length < 6 || field.value.length > 20) {
    return false;
  } else {
    return true;
  }
}
function isValidPassword(field) {
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-";
	var checkStr = field.value;
	var allValid = true;

	for (i = 0;  i < checkStr.length;  i++)
	{
	  ch = checkStr.charAt(i);
	  for (j = 0;  j < checkOK.length;  j++)
	    if (ch == checkOK.charAt(j))
	      break;
	  if (j == checkOK.length)
	  {
	    allValid = false;
	    break;
	  }
	}
	return allValid;
}

function trimString(sString)
 {
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	
	while (sString.substring(sString.length-1, sString.length) == ' ')
	 {
		sString = sString.substring(0,sString.length-1);
	}
	
	return sString;
}


function prepareForms() {
  for (var i=0; i<document.forms.length; i++) {
    var thisform = document.forms[i];    
    if ( thisform.name == "frmPayment" ||  thisform.name == "frmCheckOut" || thisform.name =="EditShipping" || thisform.name =="submitSearch" || thisform.name=="submitme") continue;
    resetFields(thisform);      	
    thisform.onsubmit = function() {
      return validateForm(this);          
    }
  }
}

function password()
{
	self.name = "Parent_Window"; 
	window.open('/portal/user/send_pass.asp','EmailLoginInfo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=350,height=260');
}
function MyAccount_DeleteSubaccont(intAssociation_id, deassociate)
{
    var ask;
    if ( deassociate == 'NO' )
    	ask = confirm("You are about to enable a Sub Account. Do you want to continue?");
    else
    	ask = confirm("You are about to disable a Sub Account. Do you want to continue?");
    	
    if(ask)
    {
        //alert("/portal/user/deletesubaccount_proc.asp?intUserAssociation_id=" + intAssociation_id);
        //return;
        document.location.href = "/portal/user/deletesubaccount_proc.asp?intUserAssociation_id=" + intAssociation_id + "&deassociate=" + deassociate;
    }
}


/* STUFF FROM DUFFS SITE */

function mouseOverEnter(link) 
{
    link.src = '/images/main/enter_button_over.jpg';
}



function mouseOutEnter(link) 
{
	link.src = '/images/main/enter_button.jpg';
}



function Popup(link,w,h) { 
    
    window.open(link,'popup','width='+w+', height='+h+', menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no');    
} 

var globalVersion = "7";

var globalBgColor="#181818";

var globalUseExpressInstall = false;

var globalRedirectURL = '';

var globalFlashId = 'hilary';

var globalFlashQuality = 'best';

var idnum=0;



/*

	Function to write a flash to a page. 

		Accepts parameters: 

			fileURL - path to a flash file

			width, height - dimenstions for flash

			div id - target where to write flash to (creates new if undefined)

			obj - parameters to be passed to flash

			useExpressInstall - check to use or not experess install to upgrade flash plug in

*/

function simpleflash(fileURL, width, height){

	if(typeof(arguments[3])=="string" && document.getElementById(arguments[3])){ // Target DIV

		var ContainerID=arguments[3];

	}else{

		var ContainerId="HilaryFlash"+(++idnum);

		document.write('<div id="'+ContainerId+'" style="width:'+width+';height:'+height+';"></div>'); //

	}

	var objParams = (typeof(arguments[4])=='object') ? arguments[4] : {} ; // Flash parameters object

	var myUseExpressInstall = (typeof(arguments[5])=='boolean') ? arguments[5] : false; // boolean check to use Express Install

	var bgColor = (typeof(arguments[6])=="string") ? arguments[6] : globalBgColor; // Background color 



    var fo = new FlashObject(fileURL, globalFlashId, width, height, globalVersion, bgColor, myUseExpressInstall);

    fo.addParam("allowScriptAccess", "sameDomain");

	fo.addParam("quality", globalFlashQuality);

	for(var item in objParams){

		fo.addVariable(item, objParams[item]); 

	}

    fo.write(ContainerID);	

}





/**

 * FlashObject v1.2.3: Flash detection and embed - http://blog.deconcept.com/flashobject/

 *

 * FlashObject is (c) 2005 Geoff Stearns and is released under the MIT License:

 * http://www.opensource.org/licenses/mit-license.php

 *

 */

if(typeof com == "undefined") var com = new Object();

if(typeof com.deconcept == "undefined") com.deconcept = new Object();

if(typeof com.deconcept.util == "undefined") com.deconcept.util = new Object();

if(typeof com.deconcept.FlashObjectUtil == "undefined") com.deconcept.FlashObjectUtil = new Object();

com.deconcept.FlashObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, redirectUrl, detectKey){

   this.DETECT_KEY = detectKey ? detectKey : 'detectflash';

   this.skipDetect = com.deconcept.util.getRequestParameter(this.DETECT_KEY);

   this.params = new Object();

   this.variables = new Object();

   this.attributes = new Array();



   if(swf) this.setAttribute('swf', swf);

   if(id) this.setAttribute('id', id);

   if(w) this.setAttribute('width', w);

   if(h) this.setAttribute('height', h);

   if(ver) this.setAttribute('version', new com.deconcept.PlayerVersion(ver.toString().split(".")));

   if(c) this.addParam('bgcolor', c);

   var q = quality ? quality : 'high';

   this.addParam('quality', q);

   this.setAttribute('redirectUrl', '');

   if(redirectUrl) this.setAttribute('redirectUrl', redirectUrl);

   if(useExpressInstall) {

   // check to see if we need to do an express install

   var expressInstallReqVer = new com.deconcept.PlayerVersion([6,0,65]);

   var installedVer = com.deconcept.FlashObjectUtil.getPlayerVersion();

      if (installedVer.versionIsValid(expressInstallReqVer) && !installedVer.versionIsValid(this.getAttribute('version'))) {

         this.setAttribute('doExpressInstall', true);

      }

   } else {

      this.setAttribute('doExpressInstall', false);

   }

  // alert('flash object created for version'+this.getAttribute('version').major+this.getAttribute('version').minor);

}

com.deconcept.FlashObject.prototype.setAttribute = function(name, value){

	this.attributes[name] = value;

}

com.deconcept.FlashObject.prototype.getAttribute = function(name){

	return this.attributes[name];

}

com.deconcept.FlashObject.prototype.getAttributes = function(){

	return this.attributes;

}

com.deconcept.FlashObject.prototype.addParam = function(name, value){

	this.params[name] = value;

}

com.deconcept.FlashObject.prototype.getParams = function(){

	return this.params;

}

com.deconcept.FlashObject.prototype.getParam = function(name){

	return this.params[name];

}

com.deconcept.FlashObject.prototype.addVariable = function(name, value){

	this.variables[name] = value;

}

com.deconcept.FlashObject.prototype.getVariable = function(name){

	return this.variables[name];

}

com.deconcept.FlashObject.prototype.getVariables = function(){

	return this.variables;

}

com.deconcept.FlashObject.prototype.getParamTags = function(){

   var paramTags = ""; var key; var params = this.getParams();

   for(key in params) {

        paramTags += '<param name="' + key + '" value="' + params[key] + '" />';

    }

   return paramTags;

}

com.deconcept.FlashObject.prototype.getVariablePairs = function(){

	var variablePairs = new Array();

	var key;

	var variables = this.getVariables();

	for(key in variables){

		variablePairs.push(key +"="+ variables[key]);

	}

	return variablePairs;

}



com.deconcept.FlashObject.prototype.getHTML = function() {

   var flashHTML = "";

    if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture

        if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }

        flashHTML += '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" id="'+ this.getAttribute('id') + '" name="'+ this.getAttribute('id') +'"';

		var params = this.getParams();

        for(var key in params){ flashHTML += ' '+ key +'="'+ params[key] +'"'; }

		pairs = this.getVariablePairs().join("&");

        if (pairs.length > 0){ flashHTML += ' flashvars="'+ pairs +'"'; }

        flashHTML += '></embed>';

    } else { // PC IE

        if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }

        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" id="'+ this.getAttribute('id') +'">';

        flashHTML += '<param name="movie" value="' + this.getAttribute('swf') + '" />';

		var tags = this.getParamTags();

        if(tags.length > 0){ flashHTML += tags; }

		var pairs = this.getVariablePairs().join("&");

        if(pairs.length > 0){ flashHTML += '<param name="flashvars" value="'+ pairs +'" />'; }

        flashHTML += '</object>';

    }

    return flashHTML;

}



com.deconcept.FlashObject.prototype.write = function(elementId){

//		   	alert("to write:"+this.getHTML());

//	alert(this.skipDetect+" || "+this.getAttribute('doExpressInstall')+" || "+com.deconcept.FlashObjectUtil.getPlayerVersion().versionIsValid(this.getAttribute('version')));

//	if(this.skipDetect || this.getAttribute('doExpressInstall') || com.deconcept.FlashObjectUtil.getPlayerVersion().versionIsValid(this.getAttribute('version'))){

		if(document.getElementById){

		   if (this.getAttribute('doExpressInstall')) {

		      this.addVariable("MMredirectURL", escape(window.location));

		      document.title = document.title.slice(0, 47) + " - Flash Player version test";

		      this.addVariable("MMdoctitle", document.title);

		   }

//		   	prompt("written HTML", this.getHTML());

			document.getElementById(elementId).innerHTML = this.getHTML();

			

		}

/*	}else{

		if(this.getAttribute('redirectUrl') != "") {

			document.location.replace(this.getAttribute('redirectUrl'));

		}

	}*/

}

/* ---- detection functions ---- */

com.deconcept.FlashObjectUtil.getPlayerVersion = function(){

   var PlayerVersion = new com.deconcept.PlayerVersion(0,0,0);

	if(navigator.plugins && navigator.mimeTypes.length){

		var x = navigator.plugins["Shockwave Flash"];

		if(x && x.description) {

			PlayerVersion = new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));

		}

	}else if (window.ActiveXObject){

	   try {

   	   var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");

   		PlayerVersion = new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));

	   } catch (e) {}

	}

	return PlayerVersion;

}

com.deconcept.PlayerVersion = function(arrVersion){

	this.major = parseInt(arrVersion[0]) || 0;

	this.minor = parseInt(arrVersion[1]) || 0;

	this.rev = parseInt(arrVersion[2]) || 0;

}

com.deconcept.PlayerVersion.prototype.versionIsValid = function(fv){

	if(this.major < fv.major) return false;

	if(this.major > fv.major) return true;

	if(this.minor < fv.minor) return false;

	if(this.minor > fv.minor) return true;

	if(this.rev < fv.rev) return false;

	return true;

}

/* ---- get value of query string param ---- */

com.deconcept.util.getRequestParameter = function(param){

	var q = document.location.search || document.location.href.hash;

	if(q){

		var startIndex = q.indexOf(param +"=");

		var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length;

		if (q.length > 1 && startIndex > -1) {

			return q.substring(q.indexOf("=", startIndex)+1, endIndex);

		}

	}

	return "";

}



/* add Array.push if needed (ie5) */

if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}



/* add some aliases for ease of use / backwards compatibility */

var getQueryParamValue = com.deconcept.util.getRequestParameter;

var FlashObject = com.deconcept.FlashObject;