function get_doc_size(){
	docHeight = $(window).height();
	docWidth = $(window).width();
}
function set_position(){
	get_doc_size();
	if(docWidth > 1000){
		$("#main_menu").css({"left": (docWidth/2) - 500 +"px"});
	}else{
		$("#main_menu").css({"left":"0px"});
	}
	$("#show_news").css({position:"absolute","left": (docWidth/2) - 500 +"px","top":"535px"});
}

function change_new(param){
	$("#news_content").stop();
	$("#new_up").html('<img src="images/tab_new_arrow_up.gif" width="12" height="12" border="0" />');
	$("#new_down").html('<img src="images/tab_new_arrow_down.gif" width="12" height="12" border="0" />');
	$("#new_up").fadeTo('fast',0.33);
	$("#new_down").fadeTo('fast',0.33);
	div_top = $("#news_content").position().top;
	if(param == 0){
		div_top = div_top + 180;
	}else{
		div_top = div_top - 180;
	}
	$("#news_content").animate({top: div_top +"px"},1000,function(){	
		if(div_top == 0){
			$("#new_down").html('<a href="javascript:void(0);" onclick="change_new(1);"><img src="images/tab_new_arrow_down.gif" width="12" height="12" border="0" /></a>');
			$("#new_down").fadeTo('fast',1);
		}else if(div_top == -360){
			$("#new_up").html('<a href="javascript:void(0);" onclick="change_new(0);"><img src="images/tab_new_arrow_up.gif" width="12" height="12" border="0" /></a>');
			$("#new_up").fadeTo('fast',1);
		}else{
			$("#new_down").html('<a href="javascript:void(0);" onclick="change_new(1);"><img src="images/tab_new_arrow_down.gif" width="12" height="12" border="0" /></a>');
			$("#new_up").html('<a href="javascript:void(0);" onclick="change_new(0);"><img src="images/tab_new_arrow_up.gif" width="12" height="12" border="0" /></a>');
			$("#new_up").fadeTo('fast',1);
			$("#new_down").fadeTo('fast',1);
		}
	});
}

function show_new_product(obj){
	h = 300;
	if(obj == "#product_cargo_04"){
		h = 450;
	}
	if(obj == "#product_cargo_05"){
		h = 750;
	}
	$("#product_cargo_01").animate({height:"10px"},500);
	$("#product_cargo_02").animate({height:"10px"},500);
	$("#product_cargo_03").animate({height:"10px"},500);
	$("#product_cargo_04").animate({height:"10px"},500);
	$("#product_cargo_05").animate({height:"10px"},500);
	$(obj).animate({height:+ h +"px"},1000);
}

function show_advise(obj){
	h = 350;
	$("#advise_cargo_01").animate({height:"10px"},500);
	$("#advise_cargo_02").animate({height:"10px"},500);
	$("#advise_cargo_03").animate({height:"10px"},500);
	$("#advise_cargo_04").animate({height:"10px"},500);
	$("#advise_cargo_05").animate({height:"10px"},500);
	$("#advise_cargo_06").animate({height:"10px"},500);
	$("#advise_cargo_07").animate({height:"10px"},500);
	$(obj).animate({height:+ h +"px"},1000);
}

function showMenu(){
	$("#main_menu").stop();
	$("#main_menu").css({"height":"400px"});
}
function hideMenu(){
	$("#main_menu").stop();
	$("#main_menu").animate({height:"99px"},100);
}

function DisplaySubmenu(obj){
	document.getElementById(obj).style.display='';
}
function CloseSubmenu(num){
	MM_swapImgRestore();
	for(var i=1;i <= num;i++){
		document.getElementById('sub_menu'+ i).style.display='none';
	}
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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];}
}
