//***********************This is for the bulk chocolate page**************************//

function Calculateit(type,typeQty)
{
	switch(type){
	case "+0;Semi sweet callets 52% cocoa (Dark);0":
		typePrice = 9
		thetotal(typePrice,typeQty)
	break;
	case "+0;Bitter sweet bulk 71% cocoa (Dark);0":
		typePrice = 9.50
		thetotal(typePrice,typeQty)
	break;
	case "+0;Bitter sweet callets 71% cocoa (Dark);0":
		typePrice = 9.50
		thetotal(typePrice,typeQty)
	break;
	case "+0;Bitter sweet callets 73% cocoa (Dark);0":
		typePrice = 12
		thetotal(typePrice,typeQty)
	break;
	case "+0;White chocolate callets 28% cocoa (White);0":
		typePrice = 8.5
		thetotal(typePrice,typeQty)
	break;
	case "+0;Milk  callets 34% cocoa (Milk);0":
		typePrice = 8.5
		thetotal(typePrice,typeQty)
	break;
	//-------------------------------------------------NEXT PULLDOWN ----------------------------------------------------------------//
	case "+0;Gran Couva 64%cocoa(Dark)":
		typePrice = 23
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Manjari 64% cocoa (Dark)":
		typePrice = 20.60
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Pur Caraibe 66% cocoa (Dark)":
		typePrice = 21
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Guanaya 70% cocoa (Dark)":
		typePrice = 21.70
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Araguani 72% cocoa (Dark)":
		typePrice = 21.70
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Pur Noir 100% cocoa (Dark)":
		typePrice = 22.50
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Extra Noir callets 53% Cocoa (Dark)":
		typePrice = 12
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Extra Amer callets 67% Cocoa (Dark)":
		typePrice = 14.25
		thetotal2(typePrice,typeQty)
	break;
	case "+0;Jivara 40% cocoa(Milk)":
		typePrice = 17.50
		thetotal2(typePrice,typeQty)
	break;
	}		
}


function thetotal(typePrice,typeQty){
	grandtotal = typePrice * typeQty
	
	switch(typeQty){
	case "1":
		document.formz2.iias_prodoptions0.value = "+" + grandtotal + ";500 Grams;0"
	break;
	case "2":
		document.formz2.iias_prodoptions0.value = "+" + grandtotal + ";1,000 Grams;0"
	break;
	case "3":
		document.formz2.iias_prodoptions0.value = "+" + grandtotal + ";1,500 Grams;0"
	break;
	case "4":
		document.formz2.iias_prodoptions0.value = "+" + grandtotal + ";2,000 Grams;0"
	break;
	case "5":
		document.formz2.iias_prodoptions0.value = "+" + grandtotal + ";2,500 Grams;0"
	break;
	}
}

function thetotal2(typePrice,typeQty){
	grandtotal = typePrice * typeQty
	switch(typeQty){
	case "1":
		document.formz.iias_prodoptions0.value = "+" + grandtotal + ";500 Grams;0"
	break;
	case "2":
		document.formz.iias_prodoptions0.value = "+" + grandtotal + ";1,000 Grams;0"
	break;
	case "3":
		document.formz.iias_prodoptions0.value = "+" + grandtotal + ";1,500 Grams;0"
	break;
	case "4":
		document.formz.iias_prodoptions0.value = "+" + grandtotal + ";2,000 Grams;0"
	break;
	case "5":
		document.formz.iias_prodoptions0.value = "+" + grandtotal + ";2,500 Grams;0"
	break;
	}
}

//***********************************************************************************//

	var loaded = 0;
	var BaseURL = "http://www.chocolatas.com/";
	
	function PreLoad() {
		
	if (document.images != null) {
	
	clickme1 = new Image();
	clickme1.src = BaseURL + "images/menu/company.gif";
	clickme2 = new Image();
	clickme2.src = BaseURL + "images/menu/company-over.gif";
	clickme3 = new Image();
	clickme3.src = BaseURL + "images/menu/collection.gif";
	clickme4 = new Image();
	clickme4.src = BaseURL + "images/menu/collection-over.gif";
	clickme5 = new Image();
	clickme5.src = BaseURL + "images/menu/corporate.gif";
	clickme6 = new Image();
	clickme6.src = BaseURL + "images/menu/corporate-over.gif";
	clickme7 = new Image();
	clickme7.src = BaseURL + "images/menu/fountains.gif";
	clickme8 = new Image();
	clickme8.src = BaseURL + "images/menu/fountains-over.gif";
	clickme9 = new Image();
	clickme9.src = BaseURL + "images/menu/weddings.gif";
	clickme10 = new Image();
	clickme10.src = BaseURL + "images/menu/weddings-over.gif";
	clickme11 = new Image();
	clickme11.src = BaseURL + "images/menu/contact.gif";
	clickme12 = new Image();
	clickme12.src = BaseURL + "images/menu/contact-over.gif";
	
	clickme13 = new Image();
	clickme13.src = BaseURL + "images/interface/index-cotm-over.gif";
	clickme14 = new Image();
	clickme14.src = BaseURL + "images/interface/index-cotm.gif";
	clickme15 = new Image();
	clickme15.src = BaseURL + "images/interface/index-specials-over.gif";
	clickme16 = new Image();
	clickme16.src = BaseURL + "images/interface/index-specials.gif";
	clickme17 = new Image();
	clickme17.src = BaseURL + "images/interface/index-events-over.gif";
	clickme18 = new Image();
	clickme18.src = BaseURL + "images/interface/index-events.gif";
	
	clickme19 = new Image();
	clickme19.src = BaseURL + "images/menu/home.gif";
	clickme20 = new Image();
	clickme20.src = BaseURL + "images/menu/home-over.gif";
	
	}
		loaded = 1;
	}
	
	function hiLite(imgDocID,imgObjName) {
	if (document.images !=null) {
	 if (loaded)
	  document.images[imgDocID].src = eval(imgObjName + ".src")
	 }
	}
	

	function popup(winName,URL,height,width) {
	 var popup = window.open(URL,winName,"height=" + height + ",width=" + width + ",left=28,top=25,status=0,scrollbars=0,toolbar=0,directories=0,menubar=0,location=0");
	 NewWindow = popup;
	 NewWindow.focus();
	}
	
	function popup1(winName,URL,height,width) {
	 var popup = window.open(URL,winName,"height=" + height + ",width=" + width + ",left=28,top=25,status=0,scrollbars=1,toolbar=0,directories=0,menubar=0,location=0");
	 NewWindow = popup;
	 NewWindow.focus();
	}

	
	    var timerID = null;
		var timerOn = false;
		var timecount = 0;
		var what = null;
		var newbrowser = true;
		var check = false;

    	function init(){
    	//  alert ("Running Init");
          if (document.layers) {
                      //  alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
                      //  alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
                      //  alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";
		  
		  }else{
		  	//alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }
		  
 
		//window.status='status bar text to go here';
		check = true;
  	 	}
	// Turns the layers on and off
        function showLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
	        	else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="visible";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
                  }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
		}

        function hideLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="hidden";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
				}
        
        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
        }

		function hideAll(){
				hideLayer('company');
				hideLayer('collection');
				//hideLayer('giftcollection');
		}
		
		function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll()" , timecount);
                timerOn = true;
	        }
		}

		function stopTime() {
	        if (timerOn) {
		        clearTimeout(timerID);
	            timerID = null;
	            timerOn = false;
	        }
		}

		function onLoad(){
			init();
		}
