jQuery(function(){
	$(".nav_menu").mouseover(function(){$(this).addClass("overs"); }).mouseout(function(){$(this).removeClass("overs"); });
	if($.browser.msie&&($.browser.version == "6.0")&&!$.support.style){
	$(".nav_menu span ul li").mouseover(function(){$(this).css("background","#31A2E4"); }).mouseout(function(){$(this).css("background","#FBFAFA"); });		
	}
var menu = $("#header_menu .current_section").html();
$("#header_menu ul:first > li").mouseover(function(){$(this).find("a:first").addClass("current_section");$(this).find("ul").addClass("active"); }).mouseout(function(){$(this).find("ul").removeClass("active");if($(this).find("a:first").html()!=menu)$(this).find("a:first").removeClass("current_section");});

$(".overs_bg").mouseover(function(){$(this).addClass("createbg");}).mouseout(function(){$(this).removeClass("createbg")});

$(".job_offer #spanclick").click(function(){$("#searcharea").decorateIframe();$("#searcharea").show();});

$(".close_area").click(function(){$("#searcharea").hide();});

$(".important_cont  div:first").click(function(){changeareaclass($(this));})
$(".other_cont  div:first").click(function(){changeareaclass($(this));});
$(".foreign_cont  div:first").click(function(){changeareaclass($(this));});

$(".important_cont  span").click(function(){$("#searcharea").hide();})
$(".other_cont  ul li div span").click(function(){$("#searcharea").hide();});
$(".foreign_cont  ul li span").click(function(){$("#searcharea").hide();});

$("#searcharea li").mouseover(function(){var id=$(this).attr('id'); $("#searcharea .provincediv").each(function(){if(this.style.display != 'none' && id != this.parentNode.id )this.style.display='none';});});
//鼠标点击切换事件
$(".other_cont ul li").toggle(function(){$(this).children("div").show();},function(){$(this).children("div").hide();});

/*$("#searcharea  span").click(function(){$(".version_cn_en .area").html($(this).html());$("#div_dis_address").val($(this).html()); $("#div_s_job_address").val($(this).parent().attr("id"));});
$("searcharea dd").click(function(){$(".version_cn_en .area").html($(this).children("span:first").html());$("#div_dis_address").val($(this).children("span:first").html()); $("#div_s_job_address").val($(this).attr("id"));});*/


$("#searcharea .important_cont span").click(function(){
	$(".area #disaree").text($(this).text());
		$("input[name=s_jobaddress]").val($(this).parent().attr("id"));
	//location.href="/home/index/id/" + $(this).parent().attr("id") ;
});
$("#searcharea .other_cont .provincediv dd").click(function(){
	$(".area #disaree").text($(this).text());
	$("input[name=s_jobaddress]").val($(this).attr("id"));
//	location.href="/home/index/id/" + $(this).attr("id") ;

});

$("#searcharea .other_cont .provincediv dt").click(function(){
	$(".area #disaree").text($(this).text());
	$("input[name=s_jobaddress]").val($(this).attr("id"));
//	location.href="/home/index/id/" + $(this).attr("id") ;
});


$("#header_search_form #keyword").focus(function(){var keyword = $.trim($(this).val()); if(keyword == JS_VAR41  ){$(this).val('');}}).blur(function(){if($.trim($(this).val()).length ==0)$(this).val(JS_VAR41);});

$("#header_search_form .green_button_style").click(function(){
	/*if($("#header_search_form #keyword").val() == JS_VAR41 || $.trim($("#header_search_form #keyword").val()).length == 0){alert(JS_VAR41);return false;}else $("#header_search_form").submit();*/
$("#header_search_form").submit();
});


$(".checkall").click(function(){var checked = $(this).attr('checked');$(".checkboxs").each(function(){this.checked =checked})});

    $.fn.decorateIframe = function(options) {
        if ($.browser.msie && $.browser.version < 7) {
            var opts = $.extend({}, $.fn.decorateIframe.defaults, options);
            $(this).each(function() {
                var $myThis = $(this);
                //创建一个IFRAME
                var divIframe = $("<iframe />");
                divIframe.attr("id", opts.iframeId).css({"position":"absolute","display":"none","display":"block","z-index":opts.iframeZIndex,"border":0,"top":"0","left":"0","filter":"mask(color=#fff)"});
                if (opts.width == 0) divIframe.css("width", $myThis.width() + parseInt($myThis.css("padding")) * 2 + "px");
                if (opts.height == 0)  divIframe.css("height", $myThis.height() + parseInt($myThis.css("padding")) * 2 + "px");
                $myThis.append(divIframe);
            });}}
    $.fn.decorateIframe.defaults = {
        iframeId:"decorateIframe1",iframeZIndex:-1,width:0,height:0
    }

});
function secodecreat(){$("#seccode").attr("src", "/plugin/captcha/cryptographp.php?cfg=0&amp;&amp;"+Math.round(Math.random(0)*1000)+1);}

function changeareaclass(o){if(o.attr("class")=='minusdiv'){o.attr("class","plusdiv");o.next("ul").hide();}else if(o.attr("class")=='plusdiv'){o.attr("class","minusdiv");o.next("ul").show();}}



function popdialogdiv(id){var clientWidth;var clientHeight;if ($.browser.msie){clientWidth = document.body.clientWidth;clientHeight =  Math.min(window.screen.availHeight-100,document.body.clientHeight);}else if ($.browser.safari){clientWidth = window.innerWidth;clientHeight = window.innerHeight;}else if ($.browser.opera){clientWidth = Math.min(window.innerWidth,document.body.clientWidth);clientHeight = Math.min(window.innerHeight,document.body.clientHeight);}else{clientWidth = Math.min(window.innerWidth,document.documentElement.clientWidth);clientHeight = Math.min(window.innerHeight,document.documentElement.clientHeight);}
	
var l=(clientWidth - $("#"+id).outerWidth())/2;var t=(clientHeight - $("#"+id).outerHeight())/2;
$("#"+id).css({"top":t+parseInt(document.documentElement.scrollTop),"left":l});$("<div class='overlayerdiv'></div>").appendTo("body");$(".overlayerdiv").css("height",document.documentElement.scrollHeight);$(".overlayerdiv").decorateIframe();$("#"+id).css("z-index","1001").show();
/*if(arguments[1] == 'no')return;
$(window).scroll(function(){$("#"+id).css("top",t+parseInt(document.documentElement.scrollTop));});*/}
function closediv(id){$("#"+id).hide();$(".overlayerdiv").remove(); $(window).unbind("scroll");}

function changelang(o,l){
var rhtml = /\.html/i;
if(l == 'cn')var rls = /,en\.html/g;
if(l == 'en')var rls = /,cn\.html/g;	
if(location.href.search(rhtml) > 0)
{
	o.href = location.href.replace(rls,','+l+'.html');
	return;	
}
		
if(l == 'cn')var rlang = /\/lang\/en/g;
if(l == 'en')var rlang = /\/lang\/cn/g;
var re = /lang/i;
if(location.href.search(re) > 0)o.href = location.href.replace(rlang,'/lang/'+l);	
else {
	if(location.href.length == 24)o.href = location.href +"home/index/lang/"+l;
	else o.href = location.href +"/lang/"+l;
}  
}



