OverlayPic = new Array();
OverlayPic[0] = new Image(); 
OverlayPic[0].src = "images/ioboard_overlay.png";
OverlayPic[1] = new Image(); 
OverlayPic[1].src = "images/pcbboard_overlay.png";
OverlayPic[2] = new Image(); 
OverlayPic[2].src = "images/backplane_overlay.png";
OverlayPic[3] = new Image(); 
OverlayPic[3].src = "images/cable_overlay.png";

var currentcat = "";
var currentscat = "";

function fnc_ShowHide(mid,cid,sid){
	categoryShoHide(mid);
	subcategoryShoHide(cid);

	if(typeof(sid) != "undefined")
		subcategoryHLight_level2(sid);
	else
		subcategoryHLight(cid);
}

function categoryShoHide(id){
	
	if(currentcat != id){
		
/*		
		//alert("id: " + id + " currentcat:" + currentcat);
		$('#ioboard').hide('slow');
		$('#pcbboard').hide('slow');
		$('#backplane').hide('slow');
		$('#cable').hide('slow');
		$('#' + id).show('slow');
		*/
		if(currentcat != "")
			$('#' + currentcat).hide('fast');
		
		$('#' + id).show('fast');
				
		currentcat=id;
	}

}

function subcategoryShoHide(id){
	if(currentscat != id){
		currentscat = id;
		scatid="cat"+id;
		$('.dsubcat').hide('slow');
		$('#' + scatid).show('slow');
	}
}
function subcategoryHLight(id)
{
	pcat="pcat"+id;
	$('.lil').css('color', '#565252');
	$('#' + pcat).css('color', '#01B60F');
}
function subcategoryHLight_level2(id)
{
	scat="scat"+id;
	$('.lil').css('color', '#565252');
	$('#' + scat).css('color', '#01B60F');
}

function categoryHLight(id)
{
	$('#tt_ioboard').css('color', '#565252');
	$('#tt_pcbboard').css('color', '#565252');
	$('#tt_backplane').css('color', '#565252');
	$('#tt_cable').css('color', '#565252');
	$('#tt_' + id).css('color', '#01B60F');
}
function categoryNoHLight()
{
	$('#tt_ioboard').css('color', '#565252');
	$('#tt_pcbboard').css('color', '#565252');
	$('#tt_backplane').css('color', '#565252');
	$('#tt_cable').css('color', '#565252');
	$('.lil').css('color', '#565252');
}
function picLoad(id)
{
	window.document.getElementById('OverLayImage').src = OverlayPic[id].src;
	window.document.getElementById('OverLay').style.display = 'block';
}
function picUnload()
{
	window.document.getElementById('OverLayImage').src="images/spacer.gif";
	window.document.getElementById('OverLay').style.display = 'none';
}
function ShowDisclaimer(url,model,flag)
{
	if(model != ''){
		window.document.getElementById('Disclaimernote').innerHTML='By proceeding further you will be accepting the terms and conditions stated in   the 3D disclaimer';
		window.document.getElementById('Disclaimerview').style.display='block';
		if(flag == 0){
			var urlId = url.replace("/pstream/","");
			window.document.getElementById('Disclaimerurltitle').innerHTML = 'Please Login or Register to proceed';
			url = "login-register.html" + urlId;			
		}else{
			window.document.getElementById('Disclaimerurltitle').innerHTML='PROCEED';
		}
	}else{
		window.document.getElementById('Disclaimernote').innerHTML='We apologize for the inconvenience, but at this time the model you have requested is unavailable.  Please contact EDAC if you require further assistance.';
		window.document.getElementById('Disclaimerview').style.display='none';
		window.document.getElementById('Disclaimerurltitle').innerHTML='Contact Us';
		url='contacts.html';
	}
	
	$('#Disclaimer').fadeIn(500);
        //$('#Disclaimerurl').attr('href',url);
        //$('#Disclaimerurl').attr('onclick','');
        $('#Disclaimerurl')[0].onclick = function(){ Popup(url, 750, 700); CloseDisclaimer(); return false; };
		//$('#Disclaimerurl')[0].onclick = window.open(url); CloseDisclaimer(); return false; };
}
function CloseDisclaimer()
{
	$('#Disclaimer').fadeOut(500);
}

$(document).ready(function(){

	$('#chat').click(function() {
		newwindow = window.open('/chat/index.php','Chat','height=500,width=560');
		if (window.focus) {newwindow.focus()}	  
	});	
        
});

