/*
	JavaScript Document
	Description	: Javascript Functions for SCiBody Electronics On-line Shop
	Date		: December 22, 2005
	-----------------------------------------------------------------------
	Copyright GenBucks International . Tulip Lab Private Limited
	Written by:	Joseph Emmanuel A. Aguilar
				President, Web Developer and Graphic Arts Designer
				X-JHEDStudios Inc.
				http://x-jhed.net | jaguilar.01@gmail.com
*/
	function stoperror(){ return true }
	window.onerror=stoperror

	pic1 = new Image();
	pic1.src = "images/proddetails_f_hl.gif";
	
	pic2 = new Image();
	pic2.src = "images/proddetails_s_hl.gif";

	pic3 = new Image();
	pic3.src = "images/proddetails_p_hl.gif";

	var primaColor = 128;

	function setActiveLink(get_ID){
		primaColor = 128;
		clearTimeout();
		document.getElementById('get_ID').value = get_ID;
		normal_menu('products');
		return false;
	}

	function animenu(){

		var sel_ID = document.getElementById('get_ID').value;
		document.getElementById(sel_ID).style.backgroundImage = 'url()';
		cNum = "RGB(" + primaColor + "," + primaColor + "," + primaColor + ")";
		document.getElementById(sel_ID).style.backgroundColor = cNum;
			
		if (primaColor == 0){
			clearTimeout(timer);
			document.getElementById(sel_ID).style.backgroundColor = 'RGB(0,0,0)';
		}
		else{
	
			primaColor=parseInt(primaColor-8);
			timer=setTimeout("animenu()",1);
			
		}

	}

	function normal_menu(sel_ID){
		
		document.getElementById(sel_ID).style.backgroundColor = 'transparent';
		document.getElementById(sel_ID).style.backgroundImage = 'url(images/invback.gif)';		
		document.getElementById('s_menu' ).style.display = 'none';
		document.getElementById('products').style.backgroundColor = 'transparent';
		document.getElementById('products').style.backgroundImage = 'url(images/invback.gif)';
		document.getElementById('products').style.borderTop = '0px solid #444444';
		document.getElementById('products').style.paddingTop = '13px';
		document.getElementById('products').style.color = '999999';
		document.getElementById('scizone').style.backgroundColor = 'transparent';
		document.getElementById('scizone').style.backgroundImage = 'url(images/invback.gif)';
		document.getElementById('scizone').style.borderTop = '0px solid #444444';
		document.getElementById('scizone').style.paddingTop = '13px';
		document.getElementById('scizone').style.color = '999999';
		
	}
	
	function show_submenu(submenu_ID){
		
		document.getElementById(submenu_ID).style.display = 'block';
		if(submenu_ID == 's_menu') tab_ID = 'products' 
		document.getElementById(tab_ID).style.backgroundColor = 'RGB(0,0,0)';
		document.getElementById(tab_ID).style.borderTop = '1px solid #444444';
		document.getElementById(tab_ID).style.paddingTop = '12px';
		document.getElementById(tab_ID).style.color = 'C0C0C0';
		
	}
	
	function hover_image(img_id,img_url){
		
		document.getElementById(img_id).src = 'images/' + img_url;
		
	}
	
	function back2normal_image(img_id,img_url){
		
		document.getElementById(img_id).src = 'images/' + img_url;
		
	}
	
	function check_tik(c_id){
		
		if(document.getElementById(c_id).checked == 0){
			document.getElementById(c_id).checked = 1;
		}
		else{
			document.getElementById(c_id).checked = 0;
		}
		
	}
	
	function displayInfo(disID){
		
		document.getElementById('fID').style.display = 'none';
		document.getElementById('tID').style.display = 'none';
		
		document.getElementById(disID).style.display = 'block';
		
		
	}
	function displayFAQ(disID){
		
		document.getElementById('fc1').style.display = 'none';
		document.getElementById('fc2').style.display = 'none';
		document.getElementById('fc3').style.display = 'none';
		document.getElementById('fc4').style.display = 'none';
		document.getElementById('fc5').style.display = 'none';
		document.getElementById('gFAQ').style.display = 'none';
		
		document.getElementById(disID).style.display = 'block';
		
		
	}
	function popWin(pageName){
		
		window.open(pageName, 'SCiBody', 'toolbar=no,location=no,directories=no,status=yes,menub ar=no,scrollbars=1,resizable=yes,copyhistory=yes,width=450,height=500');
		
	}
	
	function popPViewer(pageName){
		
		window.open(pageName, 'SCiBody', 'toolbar=no,location=no,directories=no,status=yes,menub ar=no,scrollbars=auto,resizable=no,copyhistory=yes,width=670,height=700');
		
	}
	
	function animatePD_Buttons(pd_id,astyle){

		butStatus 	= document.getElementById(pd_id+'Flag').value;
	
		if(astyle == 0){
	
			if(butStatus != 1){
			
				document.getElementById(pd_id+'IMG').src = 'images/proddetails_'+pd_id+'_hl.gif';
			
			}
		
		}
		else{
		
			if (document.getElementById('fFlag').value == 1){
				document.getElementById('fIMG').src = 'images/proddetails_f_hl.gif';
			}
			else{
				document.getElementById('fIMG').src = 'images/proddetails_03.gif';										
			}
	
			if (document.getElementById('sFlag').value == 1){
				document.getElementById('sIMG').src = 'images/proddetails_s_hl.gif';
			}
			else{
				document.getElementById('sIMG').src = 'images/proddetails_05.gif';										
			}
	
			if (document.getElementById('pFlag').value == 1){
				document.getElementById('pIMG').src = 'images/proddetails_p_hl.gif';
			}
			else{
				document.getElementById('pIMG').src = 'images/proddetails_07.gif';										
			}
		
		}
	
	}							
	
	function disSpecs(butID){
	
		document.getElementById('fFlag').value = 0;
		document.getElementById('sFlag').value = 0;
		document.getElementById('pFlag').value = 0;
		document.getElementById('fFlag_Tab').style.display = 'none';
		document.getElementById('sFlag_Tab').style.display = 'none';
		document.getElementById('pFlag_Tab').style.display = 'none';		
												
		document.getElementById(butID).value = 1;
		document.getElementById(butID+'_Tab').style.display = 'block';
		
			if (document.getElementById('fFlag').value == 1){
				document.getElementById('fIMG').src = 'images/proddetails_f_hl.gif';
			}
			else{
				document.getElementById('fIMG').src = 'images/proddetails_03.gif';										
			}
	
			if (document.getElementById('sFlag').value == 1){
				document.getElementById('sIMG').src = 'images/proddetails_s_hl.gif';
			}
			else{
				document.getElementById('sIMG').src = 'images/proddetails_05.gif';										
			}
	
			if (document.getElementById('pFlag').value == 1){
				document.getElementById('pIMG').src = 'images/proddetails_p_hl.gif';
			}
			else{
				document.getElementById('pIMG').src = 'images/proddetails_07.gif';										
			}
		
	}
	
	function addBookmarkForBrowser() {

		var ua = navigator.userAgent.toLowerCase();
		isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)); 
		isGecko = (ua.indexOf("gecko") != -1);
		
		if (document.all) {
			window.external.AddFavorite(document.location.href, document.title);
		}
		if (isGecko) {
			alert("Sorry, you're not using an IE Browser \n Auto-Bookmark is unavailable. \n \n Tip: Try pressing CTRL+D!");
		}
		
	}
	
	function launchEngine(pageName){

		window.open(pageName, 'SCiBody Chat', 'toolbar=no,location=no,directories=no,status=no,scrollbars=0,resizable=no,close=no,dependent=YES,width=400,height=500');

	}