function showMenu(i){
	switch(i)
	{
		case "dvdplayer":
			;
			break;
		case "products":
			document.getElementById("sub_prod").style.display = "block";
			document.getElementById("products").className = "hover";
			//document.getElementById("products").styleName = "hover";
			break;
		case "support":
			document.getElementById("sub_sup").style.display = "block";
			document.getElementById("support").className = "hover";
			break;
		case "solution":
			document.getElementById("sub_sol").style.display = "block";
			document.getElementById("solution").className = "hover";
			break;
		
	}
	
}
function shutMenu(j){
	switch(j)
	{
		case "products":
			document.getElementById("sub_prod").style.display = "none";
			document.getElementById("products").className = " ";
			break;
		case "support":
			document.getElementById("sub_sup").style.display = "none";
			document.getElementById("support").className = " ";
			break;
		case "solution":
			document.getElementById("sub_sol").style.display = "none";
			document.getElementById("solution").className = " ";
			break;
	}
}

window.onload = function ()
{
	var menu_go = function ()
	{
		window.location = this.href + '#' + (document.documentElement.scrollTop || document.body.scrollTop);
		return false;
	}
	
	try
	{
		var menu_a_arr = document.getElementById('nav_fix').getElementsByTagName('a');
		for (var i=0; i<menu_a_arr.length; i++)
		{
			menu_a_arr[i].onclick = menu_go;
		}
	}
	catch (e)
	{}
	
	var st = window.location.hash.match(/#(\w+)/);
	if (st)
	{
		if (document.documentElement)
			document.documentElement.scrollTop = st[1];
		else
			document.body.scrollTop = parseInt(st[1]);
	}
};
$(function(){
   $('.ad-btn').attr('href','http://www.blazevideo.com/promotion/video-magic-promotion.html');
	
  var leftsecond;
  var endtime;
  var nowtime;
  function _fresh()
  {
   endtime=new Date("May 23, 2011 00:00:00"); 
   nowtime = new Date();
   leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
   if(leftsecond<0){
	  leftsecond=0;
	  $('#video-ad-pic').show();
	  $('.video-magic-ad').hide();
   }
   if(leftsecond<259200){
	   __d=parseInt(leftsecond/3600/24);
	   __h=parseInt((leftsecond/3600)%24);
	   __m=parseInt((leftsecond/60)%60);
	   __s=parseInt(leftsecond%60);
	   if(__d<10){
		  __d="0"+__d;
	   }
	   if(__h<10){
		  __h="0"+__h;
	   }
	   if(__m<10){
		  __m="0"+__m;
	   }
	   if(__s<10){
		  __s="0"+__s;
	   }
	   document.getElementById("ad-day").innerHTML=__d;
	   document.getElementById("ad-hour").innerHTML=__h;
	   document.getElementById("ad-min").innerHTML=__m;
	   document.getElementById("ad-sec").innerHTML=__s;
   }else{
	   $('#video-ad-pic').show();
	  $('.video-magic-ad').hide();
   }
  }
  _fresh();
  
   if(leftsecond<259200&&leftsecond>0){
	  setInterval(_fresh,1000);
   }
})
