﻿//flash pic scroll
function QRFpShow(info,ww,hh)
{
var a = []; 
a = info.split('|'); 
var pics="";
var links="";
var texts="";
var Num=a.length-1;

var focus_width=ww
var focus_height=hh
var text_height=0
var swf_height = focus_height+text_height

for(var i=0; i<Num; i++)
{
pics+=a[i].split('*')[2]+"|";
links+=a[i].split('*')[1]+"|";
texts+=a[i].split('*')[0]+"|";
}
pics=pics.substring(0,pics.length-1);
links=links.substring(0,links.length-1);

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="include/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="include/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  
document.write('</object>');
}

//FLASH
function insertFlash(elm, url, w, h)
{
	if (!document.getElementById(elm)) return;
	var str = '';
	str += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
	str += '<param name="movie" value="'+ url +'">';
	str += '<param name="wmode" value="opaque">';
	str += '<param name="quality" value="autohigh">';
	str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
	str += '</object>';
	document.getElementById(elm).innerHTML = str;
}

//pic roll
function Roll(room,m1,m2,height,width,speed,type)
{
        var r=document.getElementById(room);
        var z1=document.getElementById(m1);
        var z2=document.getElementById(m2);        
        type=(type=="")?"u":type;//u:向上;d:向下;l:向左;r:向右        
        speed=(speed=="")?"50":speed;
		z2.innerHTML=z1.innerHTML;
		with(r)
		{
		    noWrap=true; //这句表内容区不自动换行
		    style.width=width; //于是我们可以将它的宽度设为0，因为它会被撑大
		    if(height!=0)
		    {
		        style.height=height;
		    }
		    style.overflowX="hidden"; //滚动条不可见			
		}
		function Marquee()
		{		
		    switch(type)
		    {
		        case "u":
			        if(z2.offsetHeight-r.scrollTop<=0)
			        {					
				        r.scrollTop-=z1.offsetHeight;
			        }
			        else
			        {					
				        r.scrollTop++;
			        }
			    break;
			    case "d":
			        if(r.scrollTop<=0)
			        {			            
				        r.scrollTop=z2.offsetHeight;				        
			        }
			        else
			        {					
				        r.scrollTop--;
			        }
			    break;
			    case "l":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+1;
				    }
			    break;
			    case "r":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+1;
				    }
			    break;			    
			}
		};
		var Time=setInterval(Marquee,speed);				
		r.onmouseover=function() 
		{		    
			clearInterval(Time);
		};
		r.onmouseout=function() 
		{
			Time=setInterval(Marquee,speed);
		}    
}

//pic roll
function Roll2(room,m1,m2,height,width,speed,type,speed2)
{
        var r=document.getElementById(room);
        var z1=document.getElementById(m1);
        var z2=document.getElementById(m2);        
        type=(type=="")?"u":type;//u:向上;d:向下;l:向左;r:向右        
        speed=(speed=="")?"50":speed;
        speed2=(speed2=="")?"10":speed2;
		z2.innerHTML=z1.innerHTML;
		with(r)
		{
		    noWrap=true; //这句表内容区不自动换行
		    style.width=width; //于是我们可以将它的宽度设为0，因为它会被撑大
		    if(height!=0)
		    {
		        style.height=height;
		    }
		    style.overflowX="hidden"; //滚动条不可见			
		}
		function Marquee()
		{		
		    switch(type)
		    {
		        case "u":
			        if(z2.offsetHeight-r.scrollTop<=0)
			        {					
				        r.scrollTop-=z1.offsetHeight;
			        }
			        else
			        {					
				        r.scrollTop++;
			        }
			    break;
			    case "d":
			        if(r.scrollTop<=0)
			        {			            
				        r.scrollTop=z2.offsetHeight;				        
			        }
			        else
			        {					
				        r.scrollTop--;
			        }
			    break;
			    case "l":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+speed2;
				    }
			    break;
			    case "r":
			        if(r.scrollLeft<=4)
				    {
					    r.scrollLeft=z2.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft-1;
				    }
			    break;			    
			}
		};
		var Time=setInterval(Marquee,speed);				
		r.onmouseover=function() 
		{		    
			clearInterval(Time);
		};
		r.onmouseout=function() 
		{
			Time=setInterval(Marquee,speed);
		}
		document.getElementById("btn_Rscroll").onclick=function() 
		{
			type = "r";
		}
		document.getElementById("btn_Lscroll").onclick=function() 
		{
			type = "l";
		}
}


//图片自动适应大小
function DrawImage(ImgD,w,h)
{   
	var image=new Image();   
	image.src=ImgD.src;   
	if(image.width>0 && image.height>0)
	{  
		if(image.width/image.height>= w/h)
		{
			if(image.width>w)
			{
				ImgD.width=w;   
				ImgD.height=(image.height*w)/image.width;   
			}
			else
			{
				ImgD.width=image.width;     
				ImgD.height=image.height;   
			}
			ImgD.alt=image.width+"×"+image.height;   
		}   
		else
		{
			if(image.height>h)
			{
				ImgD.height=h;
				ImgD.width=(image.width*h)/image.height;
			}
			else
			{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
			ImgD.alt=image.width+"×"+image.height;
		}
	}
}


/*加入收藏*/
function addBookmark(title)
{
    var url=parent.location.href;
    if (window.sidebar) 
    { 
        window.sidebar.addPanel(title, url,""); 
    }
    else if( document.all )
    {
        window.external.AddFavorite( url, title);
    }
    else if( window.opera && window.print )
    {
        return true;
    }
}



var subnav_time = 0;
function subnav_display(id)
{	
	for(var i=1;i<=20;i++)
	{
		if(document.getElementById("subnav_"+i))
		{
			 document.getElementById("subnav_"+i).style.display = "none";
		}
	}
	if(document.getElementById("subnav_"+id))
	{
		clearTimeout(subnav_time);
		document.getElementById("subnav_"+id).style.display = "block";
	}
}
function subnav_hidden(id)
{
	if(document.getElementById("subnav_"+id))
	{
		subnav_time = setTimeout('subnav_hidden2("'+ id +'")', 5000);
	}
}
function subnav_hidden2(id)
{
	document.getElementById("subnav_"+id).style.display = "none";
	clearTimeout(subnav_time);
}

function cleartxt()
{
    if(document.getElementById("ntxt").value == "请输入关键字")
    {
        document.getElementById("ntxt").value = "";
        document.getElementById("ntxt").style.color = "#000";
    }
}

function searchLP()
{
    if( (document.getElementById("nArea").value == "0") &&(document.getElementById("nPrice").value == "0") && ((document.getElementById("ntxt").value == "") || (document.getElementById("ntxt").value == "请输入关键字")) )
    {
        window.open("searchloupan.html");
    }
    else
    {
        var nArea = document.getElementById("nArea").value;
        var nPrice = document.getElementById("nPrice").value;
        var nMode = document.getElementById("nMode").value;
        var ntxt = document.getElementById("ntxt").value;
        if((ntxt == "请输入关键字")||(ntxt == ""))
        {
            window.location.href="searchshow_" + encodeURI(nArea) + "_" + nMode + "_" + encodeURI(nPrice) + ".html";
        }
        else
        {
            window.location.href = "searchshow_" + encodeURI(nArea) + "_" + nMode + "_" + encodeURI(nPrice) + "_" + encodeURI(ntxt) + ".html";
        }
    }
}



function openQQ(qqcode)
{
	var qqwindow=window.open('tencent://message/?Menu=yes&uin='+qqcode+'&Site=&Service=200');
	
	setTimeout(function(){qqwindow.close()},2000);

}


function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}
function SetHome(obj,vrl)
{
    try
    {
            obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
    }
    catch(e){
            if(window.netscape) {
                    try {
                            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
                    } 
                    catch (e) { 
                            alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
                    }
                    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                    prefs.setCharPref('browser.startup.homepage',vrl);
             }
    }
}


function switchtxt(i)
{
	if(i == "1")
	{
		document.getElementById("switch00").style.backgroundImage="url(./images/personal_422.jpg)";
		document.getElementById("switch01").style.color="#000";
		document.getElementById("switch02").style.color="#fff";
		document.getElementById("guakao").style.display="block";
		document.getElementById("qiuzhi").style.display="none";
		document.getElementById("guakao2").style.display="block";
		document.getElementById("qiuzhi2").style.display="none";

	}
	else
	{
		document.getElementById("switch00").style.backgroundImage="url(./images/personal_42.jpg)";
		document.getElementById("switch01").style.color="#fff";
		document.getElementById("switch02").style.color="#000";
		document.getElementById("guakao").style.display="none";
		document.getElementById("qiuzhi").style.display="block";
		document.getElementById("guakao2").style.display="none";
		document.getElementById("qiuzhi2").style.display="block";
	}
}

function f5_code(url)
{
   document.getElementById("yzms").src=url+"Action/ValidateCode.aspx?t="+Date.parse(new Date);
}

/*** Us_Reg ************/

function Lg_xz(tid)
{
   document.getElementById("txttypes").value=tid;
}

function Reg_Xz()
{
   var pg="";
   var tid=document.getElementById("txttypes").value;
   if(tid!="")
   {
       switch(tid)
       {
           case"1":
               pg="Resume/Register.aspx";
               break;
           case"2":
               pg="Company/Cus_Reg.aspx";
               break;
           case"3":
               pg="School/Sus_Reg.aspx";
               break;
       }
       window.open(pg);
   }
   else
   {
     alert('系统提示:请选择类型!');
   }
}

function Dl_Xz(urls)
{
   var pg="";
   var tid=document.getElementById("txttypes").value;
   pg=urls+"Action/action.aspx?act=uslg&ustid="+tid;
   if(tid!="")
   {      
      if(checkInput_ulgs()!=false)
      {
          flogin.action=pg;
          flogin.submit();
      }
   }
   else
   {
     alert('系统提示:请选择类型!');
   }
}

function checkInput_ulgs()
{
    if (document.flogin.txtus.value=="")
    {
	    alert("系统提示: 请填写登陆用户名!");
	    return false;
    }
    if (document.flogin.txtpw.value=="")
    {
        alert("系统提示：请填写登陆密码！");
        return false;
    }
    if (document.flogin.txtCode.value=="")
    {
        alert("系统提示：请填写登陆验证码！");
        return false;
    }
}

function Lk_Psw()
{
   var pg="";
   var tid=document.getElementById("txtp2").value;
   pg="Action/action.aspx?act=uslkpws&ustid="+tid;
   if(tid!="")
   {      
      if(checkInput_lkpws()!=false)
      {
          lfpws.action=pg;
          lfpws.submit();
      }
   }
   else
   {
     alert('系统提示:请选择类型!');
   }
}

function Lg_xz2(tid)
{
   document.getElementById("txtp2").value=tid;
}

function checkInput_lkpws()
{
    if (document.lfpws.txtus2.value=="")
    {
	    alert("系统提示: 请填写登陆用户名!");
	    return false;
    }
}

/*** Us_Search ************/

function Search_Xz()
{
   var pg="";
   pg="Per_Search.aspx";
   if(checkInput_ssq()!=false)
   {
   fsearch.action=pg;
   fsearch.submit();
   }
}
function checkInput_ssq()
{
    if (document.fsearch.strtxt.value=="")
    {
	    alert("系统提示: 请填写搜索关键词!");
	    return false;
    }
}










