function genFlash2() {
	isIE6 = false;
	isIE = true;

	var flashvars = {};
	flashvars.path = path;
	flashvars.xmlPath = path+'xml/';
	flashvars.imagePath = path+'images/';
	flashvars.swfPath = path+'images/swf/';
	flashvars.section = section;

	var params = {};
	params.allowscriptaccess = "always";
	params.wmode = "transparent";
	var attributes = {};
	attributes.id = "home_flashcontainer_dummy_08034670764574570703";
	swfobject.embedSWF("images/swf/mainmap.swf", "home_altermap", "100%", "100%", "9.0.0", false, flashvars, params, attributes);
	fixDupilcationOfSwfObject();
}

function checkGif4IE6() {
	/* important code the check ie6 */ 
	var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
	if (isIE6) {
		document.getElementById('home_flashmap_title').src = 'images/home/flashmap_header_title.gif';
	}
}

function init() {
	genFlash2();
	checkGif4IE6();
}

var d = document;
var contentTarget = null;

function contentOpen(target)
{	
	if (contentTarget == target)	return;
	var content = d.getElementById('jobContent_' + target);
	var title = d.getElementById('jobitemCon_' + target);
	var border = d.getElementById('jobitem_' + target);
	
	if (contentTarget) {
		var content2 = d.getElementById('jobContent_' + contentTarget);
		var title2 = d.getElementById('jobitemCon_' + contentTarget);
		var border2 = d.getElementById('jobitem_' + contentTarget);
		
		content2.style.display = 'none';
		title2.style.backgroundColor = '#B79556';
		border2.style.borderLeft = '#C2A570 3px solid';
	}
	
	if (content.style.display != 'block')
	{
		content.style.display = 'block';
		title.style.backgroundColor = '#967943';
		border.style.borderLeft = '#DCCBAB 3px solid';
	}
	contentTarget = target;
	newScroller(target);
}
function contentPreOpen()
{	
	var target = "";
	
	var url = window.location.href;
	if (url.indexOf("?") != -1){
		target = url.substring(url.indexOf("?") + 4);

		if (contentTarget == target)	return;
		var content = d.getElementById('jobContent_' + target);
		var title = d.getElementById('jobitemCon_' + target);
		var border = d.getElementById('jobitem_' + target);
		
		if (contentTarget) {
			var content2 = d.getElementById('jobContent_' + contentTarget);
			var title2 = d.getElementById('jobitemCon_' + contentTarget);
			var border2 = d.getElementById('jobitem_' + contentTarget);
			
			content2.style.display = 'none';
			title2.style.backgroundColor = '#B79556';
			border2.style.borderLeft = '#C2A570 3px solid';
		}
		
		if (content.style.display != 'block')
		{
			content.style.display = 'block';
			title.style.backgroundColor = '#967943';
			border.style.borderLeft = '#DCCBAB 3px solid';
		}
		contentTarget = target;
		newScroller(target);
	}
}



function showHideList(showList, hiddenList){
	var show_arr = showList.split("|");
	var hidden_arr = hiddenList.split("|");
	
	if (showList != ""){
		for (i = 0; i < show_arr.length; i++){
			document.getElementById("jobitemCon_" + show_arr[i]).style.display="";
			document.getElementById("jobitem_" + show_arr[i]).style.display="";
		}
	}
	
	if (hiddenList != ""){
		for (i = 0; i < hidden_arr.length; i++){
			document.getElementById("jobitemCon_" + hidden_arr[i]).style.display="none";
			document.getElementById("jobitem_" + hidden_arr[i]).style.display="none";
		}
	}
}

function dropdownbox(id)
{
	var btn = document.getElementById(id);
 
	if (btn.style.display != 'block')
	{
		btn.style.display = 'block';
		btn.onmouseover = function() {btn.hit = true;};
		btn.onmouseout= function() {
			btn.hit = false; setTimeout(function() {if (!btn.hit)	btn.style.display = 'none';}, 200);
		};
	}	
}

function newScroller(target)
{
	var newsTop = document.getElementById('newsTop_'+target);
	var newsContent = document.getElementById('newsContent_'+target);
	
	newsContent.style.height = 314 - newsTop.offsetHeight + 'px';
	
	//alert(newsContent.style.height);
}