// Rollover FunctionCSStopExecution = false;CSInit = new Array;function CSScriptInit() {idxArray = new Array;for(var i=0;i<CSInit.length;i++)	idxArray[i] = i;CSAction2(CSInit, idxArray);}CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);function IsIE() { return CSAg.indexOf("MSIE") > 0;}function CSIEStyl(s) { return document.all.tags("div")[s].style; }function CSNSStyl(s) { return CSFindElement(s,0); }function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];	var curDoc = ly ? ly.document : document; var elem = curDoc[n];	if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {		elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}	return elem;}function CSButtonReturn () {	var bAgent = window.navigator.userAgent; 	var bAppName = window.navigator.appName;	if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))		return false; // follow link	else return true; // follow link}CSIm = new Object();function CSIShow(n,i) {	if (document.images) {		if (CSIm[n]) {			var img = (!IsIE()) ? CSFindElement(n,0) : document[n];			if (img && typeof(CSIm[n][i].src) != "undefined") {img.src = CSIm[n][i].src;}			if(i != 0)				self.status = CSIm[n][3];			else				self.status = " ";			return true;		}	}	return false;}function CSILoad(action) {	im = action[1];	if (document.images) {		CSIm[im] = new Object();		for (var i=2;i<5;i++) {			if (action[i] != '') { CSIm[im][i-2] = new Image(); CSIm[im][i-2].src = action[i]; }			else CSIm[im][i-2] = 0;		}		CSIm[im][3] = action[5];	}}CSStopExecution = false;function CSAction(array) { 	return CSAction2(CSAct, array);}function CSAction2(fct, array) { 	var result;	for (var i=0;i<array.length;i++) {		if(CSStopExecution) return false; 		var actArray = fct[array[i]];		var tempArray = new Array;		for(var j=1;j<actArray.length;j++) {			if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {				if(actArray[j][0] == "VAR") {					tempArray[j] = CSStateArray[actArray[j][1]];				}				else {					if(actArray[j][0] == "ACT") {						tempArray[j] = CSAction(new Array(new String(actArray[j][1])));					}				else					tempArray[j] = actArray[j];				}			}			else				tempArray[j] = actArray[j];		}					result = actArray[0](tempArray);	}	return result;}CSAct = new Object;function CSGotoLink(action) {
	if (action[2].length) {
		var hasFrame=false;
		for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}}
		if (hasFrame==true)
			parent.frames[action[2]].location = action[1];
		else
			window.open (action[1],action[2],"");
	}
	else location = action[1];
}// Pop-up Function 1function CSOpenWindow(action) {	var wf = "";		wf = wf + "width=" + action[3];	wf = wf + ",height=" + action[4];	wf = wf + ",resizable=" + (action[5] ? "yes" : "no");	wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");	wf = wf + ",menubar=" + (action[7] ? "yes" : "no");	wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");	wf = wf + ",directories=" + (action[9] ? "yes" : "no");	wf = wf + ",location=" + (action[10] ? "yes" : "no");	wf = wf + ",status=" + (action[11] ? "yes" : "no");			window.open(action[1],action[2],wf);}// Pop-up function 2function CSURLPopupShow(formName, popupName, target) {	var form  = CSFindElement(formName);	var popup = form.elements[popupName];	window.open(popup.options[popup.selectedIndex].value, target);	popup.selectedIndex = 0;}// Macromedia Functions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_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_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];}}// onLoad="MM_preloadImages('/images/entersite2.gif')"// <a href="/fordgt/home.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('enter','','/images/entersite2.gif',1)"><img src="Images/entersite.gif" width="123" height="22" alt="ENTER SITE  &gt;&gt;" name="enter" border="0"></a>// Confirm Delete Orderfunction askDelete(idOrder) {
  if(!window.confirm("Are you sure you want to delete Order " + idOrder + "?")) 
	return false;
  return true;	
}

function askDeleteBasketItem(Item) {
  if(!window.confirm("Are you sure you want to delete " + Item + " from this order?")) 
	return false;
  return true;	
}

// Confirm Delete Userfunction askDeleteUser(idUser) {
  if(!window.confirm("Are you sure you want to delete User " + idUser + "?")) 
	return false;
  return true;	
}

// Confirm Delete Catfunction askDeleteCat(CatTitle) {
  if(!window.confirm("Are you sure you want to delete the " + CatTitle + " category?")) 
	return false;
  return true;	
}

// Confirm Delete SubCatfunction askDeleteSubCat(SubCatTitle, CatTitle) {
  if(!window.confirm("Are you sure you want to delete the Sub Category " + SubCatTitle + " from " + CatTitle + "?")) 
	return false;
  return true;	
}

// Confirm Delete WSfunction askDeleteWS(Title) {
  if(!window.confirm("Are you sure you want to delete the " + CatTitle + " wholesale pricing?")) 
	return false;
  return true;	
}

function askDeleteEvent(Item) {
  if(!window.confirm("Are you sure you want to delete the " + Item + " event?")) 
	return false;
  return true;	
}

// Menu Items Rollover
function showItem(title,text,image,evt){

	with (document.getElementById('Item').style){
		
		str = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"320\">";
		str +=	"<tr>";
		str +=	"		<td bgcolor=\"#528318\">";
		str +=	"			<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"318\">";
		str +=	"				<tr>";
		str +=	"					<td bgcolor=\"#FFFFFF\" align=\"center\">";
		str +=	"						<table border=\"0\" cellspacing=\"6\" cellpadding=\"0\" width=\"314\">";
		str +=	"							<tr>";
		if (image){
			str +=	"							<td width=\"120\">";
			str +=	"								<div class=\"small\">";
			str +=	"									<img src=\"/images/food/small/" + image + "\" width=\"120\">";
			str +=	"								</div>";
			str +=	"							</td>";
		}
		str +=	"								<td valign=\"top\">";
		str +=	"									<div class=\"small\">";
		if (text) {
			str +=	"										<font color=\"#999966\"><b>" + title + "</b></font><br>";
			str +=	"										<font color=\"#999966\">" + text + "</font></div>";
		}
		else {
			str +=	"										<font color=\"#999966\"><b>NO TEXT</b></font></div>";
		}
		str +=	"								</td>";
		str +=	"							</tr>";
		str +=	"						</table>";
		str +=	"					</td>";
		str +=	"				</tr>";
		str +=	"			</table>";
		str +=	"		</td>";
		str +=	"	</tr>";
		str +=	"</table>";
		str += "<br>";
	
		
		visibility = 'visible';
		document.getElementById('Item').innerHTML = str;
		
		if (document.all){

			left = evt.x;
			top = evt.y + (document.body.scrollTop + 10);

		}

		else{

			left = evt.pageX;
			top = evt.pageY;

		}
		
	}

}
		
// Hide Menu Items Rollover
function hideItem(){

		document.getElementById('Item').style.visibility='hidden';

}

// Hide Div Pass - Replace top if neccessary
function hideDiv(idDiv){
		document.getElementById(idDiv).style.visibility='hidden';
}
function showDiv(idDiv){
		document.getElementById(idDiv).style.visibility='visible';
}

// ValidateField
// Use this onBlur="checkInput(this)" in input tag
function checkInput(element) {
  if (element.value == "")
    alert("Please enter a value!");
}

function IsANumber(formField)
{
var valid = "0123456789."
var ok = "yes";
var temp;

	for (var i=0; i < formField.value.length; i++)
	{
		temp = "" + formField.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1")
		return false;
	}
}


function ValidateOnBlur(formField, minimumAllowed)
{
	if (IsANumber(formField) == false)
	{
		alert("Please enter a number.");
		formField.focus();
		formField.select();
		return;
	}
	if (formField.value < minimumAllowed && formField.value != 0)
	{
		{
			alert("There is a minimum order of " + minimumAllowed + " for this item.");
		}
		formField.focus();
		formField.select();
		return;
	}
}

function add_ItemTotal(fldQty,fldPrice,fldSPrice,fldITotal) {
	var iTotal;
	var q = fldQty.value;
	var op = fldPrice.value;
	var sp = fldSPrice.value;
	
	if (sp > 0){
		iTotal = parseFloat(Math.round((q * sp)*100)/100)
	}
	else {
		iTotal = Math.round((q * op)*100)/100
	}
	
	fldITotal.value = iTotal;
	document.forms.frmModify.txtOrderSubTotal.focus();
	return iTotal;
}

function add_Weight(fldQty,fldWeight,fldTWeight) {
	var iTotal;
	var q = fldQty.value;
	var w = fldWeight.value;
	
	iTotal = Math.round((q * w)*100)/100
	
	fldTWeight.value = iTotal;
	return;
}

function add_SubTotal() {
	var loop=0, sum=0;
	for (loop = arguments.length-1; loop>=0; loop--)
		sum += parseFloat(arguments[loop]);
	
	document.forms.frmModify.txtOrderSubTotal.value = Math.round(sum*100)/100;
	document.forms.frmModify.txtOrderTotal.focus();
	return;
}

function add_Total() {
	var loop=0, sum=0;
	for (loop = arguments.length-1; loop>=0; loop--)
		sum += parseFloat(arguments[loop]);
	
	document.forms.frmModify.txtOrderTotal.value = Math.round(sum*100)/100;
	return;
}

function finalCheck(formField) {
    var proceed = true
    proceed = IsANumber(formField)
    if (!proceed)
		formField.focus();
		formField.select();
		return false;
		return proceed;
}

// Beginning of Address Script

    function Location(pId, pLabel, pCompany, pAddress, pCity, pState, pZip, pResidence, pPhone, pFax, pCountry) {
        this.pId = pId;
        this.pLabel = pLabel;
        this.pCompany = pCompany;
        this.pAddress = pAddress;
        this.pCity = pCity;
        this.pState = pState;
        this.pZip = pZip;
        this.pResidence = pResidence;
        this.pPhone = pPhone;
        this.pFax = pFax;
        this.pCountry = pCountry;
    }

    //function sets APARTMENT field to null if NONE is checked
    function pj_set_APARTMENT() {
        if (document.form1.apt_code[3].checked) {
            document.form1.apt_code_ext.value = "";
            document.form1.city.focus();
        }
    }

    function changeAddress() {
        var f = document.forms[0];
        var i;
        var val = f.location_id.options[f.location_id.selectedIndex].value;

        var cnt;
        var found = false;
        for (cnt = 0; !found && cnt < locations.length; cnt++) {
            if (locations[cnt].pId == val) {
              found = true;
            }
        }
        cnt = cnt - 1;
        if (found) {
            populateScreen(cnt);
        }
        else {
            clearScreen();
        }
    }

    function clearScreen() {
        var f = document.forms[0];
        document.form1.txtShipCompany.value     = "";
        document.form1.txtShipAddress.value     = "";
        document.form1.txtShipCity.value        = "";
        document.form1.txtShipState.value       = "";
        document.form1.txtShipZip.value			= "";
        document.form1.txtShipPhone.value       = "";
        document.form1.txtShipFax.value         = "";
        document.form1.txtShipCountry.value     = "";
        document.form1.txtLocationTitle.value   = "";

        for (i = 0; i < f.rbHomeDelivery.length; i++) {
            f.rbHomeDelivery[i].checked = false;
        }
        //document.getElementById('lTitle').style.visibility='visible';
        //document.getElementById('lField').style.visibility='visible';
    }

    function populateScreen(cnt) {
        var f = document.forms[0];
        document.form1.txtShipCompany.value     = locations[cnt].pCompany;
        document.form1.txtShipAddress.value     = locations[cnt].pAddress;
        document.form1.txtShipCity.value        = locations[cnt].pCity;
        document.form1.txtShipState.value       = locations[cnt].pState;
        document.form1.txtShipZip.value			= locations[cnt].pZip;
        document.form1.txtShipPhone.value       = locations[cnt].pPhone;
        document.form1.txtShipFax.value         = locations[cnt].pFax;
        document.form1.txtShipCountry.value     = locations[cnt].pCountry;
        document.form1.txtLocationTitle.value   = locations[cnt].pLabel;
		
        //document.getElementById('lTitle').style.visibility='hidden';
        //document.getElementById('lField').style.visibility='hidden';
		
        // set rbHomeDelivery/TRUE/FALSE
        for (i=0; i< f.rbHomeDelivery.length; i++) {
            f.rbHomeDelivery[i].checked = (f.rbHomeDelivery[i].value == locations[cnt].pResidence);
        }
    }
// End of Address Script

function frmValidate() {
missinginfo = "";
if (document.catreq.realname.value == "") {
missinginfo += "\n     -  Name";
}
if (document.catreq.Address.value == "") {
missinginfo += "\n     -  Address";
}
if (document.catreq.City.value == "") {
missinginfo += "\n     -  City";
}
if (document.catreq.State.value == "") {
missinginfo += "\n     -  State";
}
if (document.catreq.Zip.value == "") {
missinginfo += "\n     -  Zip Code";
}
if (document.catreq.Email.value == "") {
missinginfo += "\n     -  E-mail";
}
if (missinginfo != "") {
missinginfo ="____________________________________\n" +
"The following field(s) were not properly filled in:\n" +
missinginfo + "\n____________________________________" +
"\nPlease correct these field(s)\n" +
"and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

// Array for Rollovers
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_home',/*URL*/'/images/nav/btn_home_off.gif',/*URL*/'/images/nav/btn_home_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_artists',/*URL*/'/images/nav/btn_artists_off.gif',/*URL*/'/images/nav/btn_artists_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_store',/*URL*/'/images/nav/btn_store_off.gif',/*URL*/'/images/nav/btn_store_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_merchandise',/*URL*/'/images/nav/btn_merchandise_off.gif',/*URL*/'/images/nav/btn_merchandise_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_thelabel',/*URL*/'/images/nav/btn_thelabel_off.gif',/*URL*/'/images/nav/btn_thelabel_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_production',/*URL*/'/images/nav/btn_production_off.gif',/*URL*/'/images/nav/btn_production_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_events',/*URL*/'/images/nav/btn_events_off.gif',/*URL*/'/images/nav/btn_events_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_streetteam',/*URL*/'/images/nav/btn_streetteam_off.gif',/*URL*/'/images/nav/btn_streetteam_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_photos',/*URL*/'/images/nav/btn_photos_off.gif',/*URL*/'/images/nav/btn_photos_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_media',/*URL*/'/images/nav/btn_media_off.gif',/*URL*/'/images/nav/btn_media_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_about',/*URL*/'/images/nav/btn_about_off.gif',/*URL*/'/images/nav/btn_about_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_links',/*URL*/'/images/nav/btn_links_off.gif',/*URL*/'/images/nav/btn_links_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_contact',/*URL*/'/images/nav/btn_contact_off.gif',/*URL*/'/images/nav/btn_contact_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_faq',/*URL*/'/images/nav/btn_faq_off.gif',/*URL*/'/images/nav/btn_faq_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_logout',/*URL*/'/images/nav/btn_logout_off.gif',/*URL*/'/images/nav/btn_logout_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_login',/*URL*/'/images/nav/btn_login_off.gif',/*URL*/'/images/nav/btn_login_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_csmain',/*URL*/'/images/nav/btn_csmain_off.gif',/*URL*/'/images/nav/btn_csmain_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_youraccount',/*URL*/'/images/nav/btn_youraccount_off.gif',/*URL*/'/images/nav/btn_youraccount_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_downloads2',/*URL*/'/images/nav/btn_downloads_off.gif',/*URL*/'/images/nav/btn_downloads_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_yourprofile',/*URL*/'/images/nav/btn_yourprofile_off.gif',/*URL*/'/images/nav/btn_yourprofile_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_previousorders',/*URL*/'/images/nav/btn_previousorders_off.gif',/*URL*/'/images/nav/btn_previousorders_on.gif',/*URL*/'','');CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_yourcart',/*URL*/'/images/nav/btn_yourcart_off.gif',/*URL*/'/images/nav/btn_yourcart_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_hd',/*URL*/'/images/footer/hd_logo_off.gif',/*URL*/'/images/footer/hd_logo_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_juanito',/*URL*/'/images/footer/juanito_logo_off.gif',/*URL*/'/images/footer/juanito_logo_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_jr',/*URL*/'/images/footer/jr_logo_off.gif',/*URL*/'/images/footer/jr_logo_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_mediakit',/*URL*/'/images/buttons/btn_mediakit_off.gif',/*URL*/'/images/buttons/btn_mediakit_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_newsarticles',/*URL*/'/images/buttons/btn_newsarticles_off.gif',/*URL*/'/images/buttons/btn_newsarticles_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_downloads',/*URL*/'/images/buttons/btn_downloads_off.gif',/*URL*/'/images/buttons/btn_downloads_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_tellafriend_product',/*URL*/'/images/buttons/btn_tellafriend_product_off.gif',/*URL*/'/images/buttons/btn_tellafriend_product_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_lm_customcreations',/*URL*/'/images/buttons/btn_lm_customcreations_off.gif',/*URL*/'/images/buttons/btn_lm_customcreations_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_viewcollectible',/*URL*/'/images/buttons/btn_viewcollectible_off.gif',/*URL*/'/images/buttons/btn_viewcollectible_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_viewlimitededition',/*URL*/'/images/buttons/btn_viewlimitededition_off.gif',/*URL*/'/images/buttons/btn_viewlimitededition_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_sponsors',/*URL*/'/images/buttons/btn_sponsors_off.gif',/*URL*/'/images/buttons/btn_sponsors_on.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'btn_requestcc',/*URL*/'/images/buttons/btn_requestcc_off.gif',/*URL*/'/images/buttons/btn_requestcc_on.gif',/*URL*/'','');

// Array for button controls
CSAct[/*CMP*/ 'EmptyBasket'] = new Array(CSGotoLink,/*URL*/ '/shop/emptybasket.asp','');
CSAct[/*CMP*/ 'CheckOut'] = new Array(CSGotoLink,/*URL*/ '/shop/SignIn.asp?action=shipping','');

// Popup Arrays
CSAct['HOWTOORDER'] = new Array(CSOpenWindow,'/shop/p_HowToOrder.html','',470,400,false,true,false,false,false,false,false);
CSAct['PLAYER'] = new Array(CSOpenWindow,'/player/default.asp','',290,105,false,false,false,false,false,false,false);
