    function checkUserSave(f) {
        var mval = f.Login;
        if (mval.value.length > 0) {
	    var str1="Do you really want to SAVE " + mval.value + " ?";
            if (confirm(str1)) {
		return mval.value;
	    }
	    else {
		mval.value = "";
	    }
	    return;
	 }
    }

    function checkUserDelete(f) {
            var uval = f.Login;
            if (uval.value.length > 0) {
    	    	str2="Do you really want to DELETE " + uval.value + " ?";
                if (confirm(str2)) {
    			return uval.value;
    	    	}
    	    	else {
    			uval.value = "";
    	    	}
    	    	return;
    	    } else {
    	       	str2="No Login selected!";
	        if (confirm(str2)) {
	    		return uval.value;
	       	}
	       	else {
	    		uval.value = "";
	       	}
    	    	return;
    	    }

    }
    function checkUserLogout(f) {
            var ulval = "LOGOUT";
   	    str2="Do you really want to Logout " + " ?";
            if (confirm(str2)) {
   		return ulval.value;
    	    }
    	    else {
    		ulval.value = "";
    	    }
    	    return;
    }
    function checkUserEditAdd(f) {
                 var edval = f.Login;
                 if (edval.value.length <= 0) {
         	    	str2="No Login selected!";
                     if (confirm(str2)) {
         		return edval.value;
         	     } else {
         		edval.value = "";
         	     }
         	     return;
         	  }
    }
    function checkMatchInventory (f) {
                 var invNum = f.inventory_num;
                 var ordNum = f.order_number;
                 if (invNum.value < ordNum.value) {
         	   	  alert("Inventory="+invNum.value +", Order= " + ordNum.value+", We are sorry, your order amount is not matched to our inventory!");
         	   	  ordNum.value = "";
         	   	  return;
         	  }
    }
    function checkUserPassword(f) {
                 var lgnval = f.login;
                 var pwdval = f.password;
                 var submval=f.SubmitLogin
                 if (lgnval.value.length <= 0 || pwdval.value.length <= 0) {
         	     alert("No login or password was entered!");
         	     submval.value="";
         	     return;
        	 }
    }

    function existusercheckout(f) {
                 var lgnval = f.login;
                 var pwdval = f.password;
                 var submval=f.SubmitExUserCheckOut
                 if (lgnval.value.length <= 0 || pwdval.value.length <= 0) {
         	     alert("No login or password was entered!");
         	     submval.value="";
         	     return;
        	 }
    }
 



    function popout(f) {
    	open.window('',this.f);
    }
    

function MM_swapImgRestore() {
  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() {
  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) {
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
  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 MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);

}


function ShipToBillPerson(form) {
   if(form.checkboxshipaddr.checked){
	    form.sCompanyName.value = form.CompanyName.value;
	    form.sFirstName.value = form.FirstName.value;
	    form.sMiddleName.value = form.MiddleName.value;
	    form.sLastName.value = form.LastName.value;
	    form.sEMail.value = form.EMail.value;
	    form.sDayPhone.value = form.DayPhone.value;
	    form.sNightPhone.value = form.NightPhone.value;
	    form.sStreet1.value = form.Street1.value;
	    form.sStreet2.value = form.Street2.value;
	    form.sCity.value = form.City.value;
	    form.sState.selectedIndex = form.State.selectedIndex;
	    form.sZip.value = form.Zip.value;

    }
//        else{
//			  form.sCompanyName.value = "";
//            form.saddr1.value = "";
//            form.saddr2.value = "";
//            form.scity.value = "";
//            form.szip.value = "";
//            form.sstate.selectedIndex = 0;

//                form.sstate2.value = "";
//                form.scountry.value = "US";

//        }
}
	
// select url	
	function select_url (menu) {
		var myhref=menu.selected_color.options[menu.selected_color.selectedIndex].value;
//		var myhref = sel.selected_color.options[sel.selected_color.selectedIndex].value;

		if (myhref == "")
		  return;
		window.location= myhref;
	}
	

	function runjPop(domain,image,jpWidth,jpHeight)
	{
		var jpOptions='titlebar=0,toolbar=0,location=0,menubar=0,scrollbars=0,resizable=0,channelmode=0,directories=0,status=0';
		var winwd=jpWidth + 15;
		var winHt=jpHeight + 15;
		var jPop='width='+winwd + ',height='+winHt +','+jpOptions;
//		if(parseFloat(navigator.appVersion)>=4)
//			jPop+=',top='+screen.height/2-jpHeight/2+',left='+screen.width/2-jpWidth/2;
		var jp=window.open('','_blank', jPop, true);

		jp.document.writeln("<img src=" + "http://" + domain + "/products/" + image + " width="+jpWidth+" height="+jpHeight+">");
	//	jp.blur();
	//	self.focus();
	}	
	

	var WindowObjectReference; /* Declaring a global variable which will store a reference to the new window to be created */
	var url;
	function openRequestedPopup(url)
	{
	WindowObjectReference = window.open(url, "Printing Invoice",
	"menubar=yes, toolbar=no,location=no,resizable=yes,scrollbars=yes,status=no");
	}

	

//Flash presentation

var imgUrl=new Array();
var imgLink=new Array();
var adNum=1;
imgUrl[0]="products/PC9102-80-45-m.jpg";
imgLink[0]="index.php?page=Ceiling_Fixtures&subpg=Pendant&dispid=9";

imgUrl[1]="products/PC9102-80-45-m.jpg";
imgLink[1]="index.php?page=Ceiling_Fixtures&subpg=Pendant&dispid=9";

imgUrl[2]="products/WS8700-8-45-1-m.jpg";
imgLink[2]="index.php?page=Wall_Fixtures&subpg=Sconce&dispid=10";

imgUrl[3]="products/WS8700-0-15-2L-m.jpg";
imgLink[3]="index.php?page=Wall_Fixtures&subpg=Sconce&dispid=10";

imgUrl[4]="products/Ws8700-8-45-3l-m.jpg";
imgLink[4]="index.php?page=Wall_Fixtures&subpg=Sconce&dispid=10";

imgUrl[5]="products/20641-m.jpg";
imgLink[5]="index.php?page=Wall_Fixtures&subpg=Vanity";
imgUrl[6]="products/20642-m.jpg";
imgLink[6]="index.php?page=Wall_Fixtures&subpg=Vanity";

imgUrl[7]="products/PC1800-8-16M-m.jpg";
imgLink[7]="index.php?page=Ceiling_Fixtures&subpg=Pendant&dispid=8";


imgUrl[39]="products/20643-m.jpg";
imgLink[39]="index.php?page=Wall_Fixtures&subpg=Vanity";

imgUrl[8]="products/50308-m.jpg";
imgLink[8]="index.php?page=Portables&subpg=Table_Lamp";

imgUrl[9]="products/50334-m.jpg";
imgLink[9]="index.php?page=Portables&subpg=Table_Lamp";



imgUrl[10]="products/50512-m.jpg";
imgLink[10]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";
imgUrl[11]="products/50030-m.jpg";
imgLink[11]="index.php?page=Ceiling_Fixtures&subpg=Flush_Mount";
imgUrl[12]="products/50020-m.jpg";
imgLink[12]="index.php?page=Ceiling_Fixtures&subpg=Flush_Mount";

imgUrl[13]="products/50533-m.jpg";
imgLink[13]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";
imgUrl[14]="products/50534-m.jpg";
imgLink[14]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";

imgUrl[15]="products/50421-m.jpg";
imgLink[15]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";
imgUrl[16]="products/50104-m.jpg";
imgLink[16]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";

imgUrl[17]="products/50510-m.jpg";
imgLink[17]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";

imgUrl[18]="products/52030-m.jpg";
imgLink[18]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";
imgUrl[19]="products/63015-m.jpg";
imgLink[19]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";
imgUrl[20]="products/52034-m.jpg";
imgLink[20]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";

imgUrl[21]="products/52029-m.jpg";
imgLink[21]="index.php?page=Ceiling_Fixtures&subpg=Flush_Mount";
imgUrl[22]="products/52133-m.jpg";
imgLink[22]="index.php?page=Ceiling_Fixtures&subpg=Flush_Mount";
imgUrl[23]="products/63303-m.jpg";
imgLink[23]="index.php?page=Ceiling_Fixtures&subpg=Spotlights";
imgUrl[24]="products/63301-m.jpg";
imgLink[24]="index.php?page=Ceiling_Fixtures&subpg=Spotlights";

imgUrl[25]="products/50055-m.jpg";
imgLink[25]="index.php?page=Ceiling_Fixtures&subpg=Pendant ";
imgUrl[26]="products/50075-m.jpg";
imgLink[26]="index.php?page=Ceiling_Fixtures&subpg=Pendant ";


imgUrl[27]="products/50421-m.jpg";
imgLink[27]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";
imgUrl[28]="products/50431-m.jpg";
imgLink[28]="index.php?page=Ceiling_Fixtures&subpg=Semi_Flush";

imgUrl[29]="products/50084-m.jpg";
imgLink[29]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";
imgUrl[30]="products/50103-m.jpg";
imgLink[30]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";

imgUrl[31]="products/64070-m.jpg";
imgLink[31]="index.php?page=Wall_Fixtures&subpg=Vanity";

imgUrl[32]="products/64071-m.jpg";
imgLink[32]="index.php?page=Wall_Fixtures&subpg=Vanity";

imgUrl[33]="products/62051-m.jpg";
imgLink[33]="index.php?page=Wall_Fixtures&subpg=Vanity";

imgUrl[34]="products/20660-m.jpg";
imgLink[34]="index.php?page=Wall_Fixtures&subpg=Sconce";
imgUrl[35]="products/62054-m.jpg";
imgLink[35]="index.php?page=Wall_Fixtures&subpg=Sconce";
imgUrl[36]="products/62084-m.jpg";
imgLink[36]="index.php?page=Wall_Fixtures&subpg=Sconce";

imgUrl[37]="products/62088_BRZ-m.jpg";
imgLink[37]="index.php?page=Wall_Fixtures&subpg=Spotlights&dispid=5";

imgUrl[37]="products/62088_BRZ-m.jpg";
imgLink[37]="index.php?page=Wall_Fixtures&subpg=Spotlights&dispid=5";

imgUrl[38]="products/KF180OZ-m.jpg";
imgLink[38]="index.php?page=Ceiling_Fans&subpg=Contemporary&dispid=1";

imgUrl[39]="products/20643-m.jpg";
imgLink[39]="index.php?page=Wall_Fixtures&subpg=Vanity";
imgUrl[40]="products/23400-m.jpg";
imgLink[40]="index.php?page=Ceiling_Fixtures&subpg=Pendant";

imgUrl[41]="products/23826-m.jpg";
imgLink[41]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";
imgUrl[42]="products/50054-m.jpg";
imgLink[42]="index.php?page=Ceiling_Fixtures&subpg=Chandelier";
imgUrl[43]="products/23004-m.jpg";
imgLink[43]="index.php?page=Ceiling_Fixtures&subpg=Pendant";


var piclength=imgUrl.length-1
//alert(piclength)

var imgPre=new Array();
var j=0;
for (i=1;i<=piclength;i++) {
	if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
		j++;
	} else {
		break;
	}
}

function playTran(){
	if (document.all)
		imgInit.filters.revealTrans.play();
}

var key=0;
var theTimer=0

function nextAd(){
	if(adNum<j) adNum++ ;
	else adNum=1;

	if( key==0 ){
		key=1;
	} else if (document.all){
		imgInit.filters.revealTrans.Transition=43;
		imgInit.filters.revealTrans.apply();
		   playTran();

	}
	document.images.imgInit.src=imgUrl[adNum];
	theTimer=setTimeout("nextAd()", 4000);
}


function lastAd(){
	if(adNum>1)adNum-- ;
	else adNum=piclength;

	if( key==0 ){
		key=1;
	} else if (document.all){
		imgInit.filters.revealTrans.Transition=43;
		imgInit.filters.revealTrans.apply();
		   playTran();

	}
	document.images.imgInit.src=imgUrl[adNum];
	theTimer=setTimeout("lastAd()", 5000);
}


function nextpic(){

	clearTimeout(theTimer);

	if(adNum<j) 
		adNum++;
	else 
		adNum=1;

	if( key==0 ){
		key=1;
	} else if (document.all){
		imgInit.filters.revealTrans.Transition=43;
		imgInit.filters.revealTrans.apply();
		   playTran();

	}
	document.images.imgInit.src=imgUrl[adNum];
	theTimer=setTimeout("nextAd()", 4000);
}



function stoppic(){
	 clearTimeout(theTimer)
	 //alert(theTimer)
}


function lastpic(){

	clearTimeout(theTimer);

	if(adNum>1)
		adNum--;
	else 
		adNum=piclength;

	if( key==0 ){
		key=1;
	} else if (document.all){
		imgInit.filters.revealTrans.Transition=28;
		imgInit.filters.revealTrans.apply();
		   playTran();

	}
	document.images.imgInit.src=imgUrl[adNum];
	theTimer=setTimeout("lastAd()", 4000);
}


function goUrl(){
	jumpUrl=imgLink[adNum];
//	jumpTarget='_blank';
	jumpTarget='';
	if (jumpUrl != ''){
		if (jumpTarget != '')
			window.open(jumpUrl,jumpTarget);
		else
			location.href=jumpUrl;
	}
}



