function fixBottom() {
	var objTemp = document.getElementById('footer');
	var value = document.documentElement.scrollTop+document.documentElement.clientHeight-objTemp.offsetHeight-(parseInt(objTemp.currentStyle.marginTop,10)||0)-(parseInt(objTemp.currentStyle.marginBottom,10)||0);
	objTemp.style.top = value;
}
function viewGnbsub(layerId){
	if (document.getElementById('business')) {
		var sublayer_length = 4;
		var divId = "subLayer2";
	} else {
		var sublayer_length = 5;
		var divId = "subLayer";
	}
	for(var i=1;i<=sublayer_length;i++){
		if(layerId==divId+i) {
			if(layerId != "none") document.getElementById(divId+i).style.display = "block";
		} else {
			document.getElementById(divId+i).style.display = "none";
		}
	}
}

jQuery(document).ready(function () {
	if ( (/MSIE 6\.0/).test(navigator.userAgent) && !(/MSIE 7\.0/).test(navigator.userAgent) ) {
		DD_belatedPNG.fix(".FixPng");		
		/*jQuery(window).scroll( fixBottom );
		jQuery(window).resize( fixBottom );*/
	}
	$("#listMenu > li").mouseover(function() {
		var layerIdarg = $(this).find("div").attr("id");
		viewGnbsub(layerIdarg);
	});
	$("#listMenu > li").mouseout(function() {
		viewGnbsub("none");
	});
	$("#listMenu > li > div").mouseout(function() {
		viewGnbsub("none");
	});

	var height = $(window).height();
//	var header = $("#header").height();
//	var box = $("#mainHome").height();
// 	var footer = $("#footer").height();
//	var flashheight = height - (header+box+footer);
//1004px
	embedFlash ({
		url: "swf/homeflash.swf",
		width: "100%", 
		height: height-4,
		flashPlayerID: "flashcontent",
		flashVersion: "9",
		wmode: 'transparent'
	});
	
	embedFlash ({
		url: "swf/homeflash2.swf",
		width: "100%", 
		height: height-4,
		flashPlayerID: "flashcontent2",
		flashVersion: "9",
		wmode: 'transparent'
	});
	
	$('.SearchField input').bind('keypress', function(e) {
        if(e.keyCode==13){
				var text = $('.SearchField input').val();
				url='search.php?val='+text;
               $(location).attr('href',url);
			   return false;
        }
	});
	
});

/* ========================== MY ================================ */
function myPop(strURL){
	var strlink = 'pop.php?url='+strURL;
	adWindow = window.open(strlink, "img", "height=550,width=800,scrollbars=yes,left=50,top=50,menubar=no,location=no,resizable=yes,toolbar=no");
		adWindow.focus();
}


