
function calculateDate(){
	var currentDate;
	var sysDate = new Date();
	var year = sysDate.getFullYear();   //获取完整的年份(4位,1970-????)   
	var month = sysDate.getMonth()+1;       //获取当前月份(0-11,0代表1月)   
	var day = sysDate.getDate();       //获取当前日(1-31)   
	var week = sysDate.getDay();         //获取当前星期X(0-6,0代表星期天)
	if(week==1) week="一";
	if(week==2) week="二";
	if(week==3) week="三";
	if(week==4) week="四";
	if(week==5) week="五";
	if(week==6) week="六";
	if(week==0) week="日";
	currentDate=year+"年"+month+"月"+day+"日 星期"+week;
	return currentDate;
}

function swf(path,width,height) {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'"> ');
    document.write('<param name="movie" value="'+path+'">');
    document.write('<param name="quality" value="high"> ');
    document.write('<param name="wmode" value="transparent"> ');
    document.write('<param name="menu" value="false"> '); 
    document.write('<embed wmode="transparent" src="'+path+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed> ');
    document.write('</object> ');
} 

function scrollLeft(){
document.write('<table align=center width=742 border=0 cellpadding=0 cellspacing=0">'); 
		document.write(' <tr> '); 
		document.write(' <td width=742px height=150px align=center>'); 
		document.write(' <div id=demo style="overflow:hidden;width:742px;" align=center>'); 
		document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >'); 
		document.write(' <tr>'); 
		document.write(' <td valign=top  id=marquePic1> '); 
		document.write(' <table width=90% border=0 cellspacing=0 cellpadding=0>'); 
		document.write(' <tr align=center> '); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=jewerly"><img src="images/yuzhui.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=clock"><img src="images/shoubiao.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=jewerly"><img src="images/jiezhi.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=other"><img src="images/bijiben.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=camera"><img src="images/dv.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=other"><img src="images/phone.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=jewerly"><img src="images/yupei.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=other"><img src="images/jiadian.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=other"><img src="images/qiupi.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=jewerly"><img src="images/erhuan.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' <td><a href="inner/sale_goods/salegoods_entrance.jsp?lsjg=xidan&type=camera"><img src="images/camera.jpg" width="100px" border="0"/></a></td>'); 
		document.write(' </tr>'); 
		document.write(' </table>'); 
		document.write(' </td>'); 
		document.write(' <td id=marquePic2 valign=top></td>'); 
		document.write(' </tr>'); 
		document.write(' </table>'); 
		document.write(' </div>'); 
		document.write(' </td>'); 
		document.write(' </tr>'); 
		document.write(' </table>'); 
		var speed=30;
		var marquePic2=document.getElementById("marquePic2");
		var marquePic1=document.getElementById("marquePic1");
		var demo=document.getElementById("demo");
		marquePic2.innerHTML=marquePic1.innerHTML;
		function Marquee(){ 
			if(demo.scrollLeft>=marquePic1.scrollWidth){ 
				demo.scrollLeft=0 
			}else{ 
				demo.scrollLeft++ 
		 	} 
		} 
		var MyMar=setInterval(Marquee,speed) 
		demo.onmouseover=function() {clearInterval(MyMar)} 
		demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} 
}

function scrollUpBegin(){
	Pause(this,2000);//调用暂停函数
	this.NextStep=function(){ 
	scrollUp();
	} 
}

function scrollUp(){

function $(element){
if(arguments.length>1){
for(var i=0,length=arguments.length,elements=[];i<length;i++){
elements.push($(arguments[i]));
}
return elements;
}
if(typeof element=="string"){
return document.getElementById(element);
}else{
return element;
}
}
var Class={
create:function(){
return function(){
this.initialize.apply(this,arguments);
}
}
}
Function.prototype.bind=function(object){
var method=this;
return function(){
method.apply(object,arguments);
}
}
var Scroll=Class.create();
Scroll.prototype={
initialize:function(element,height){
this.element=$(element);
this.element.innerHTML+=this.element.innerHTML;
this.height=height;
this.maxHeight=this.element.scrollHeight/2;
this.counter=0;
this.scroll();
this.timer="";
this.element.onmouseover=this.stop.bind(this);
this.element.onmouseout=function(){this.timer=setTimeout(this.scroll.bind(this),1000);}.bind(this);
},
scroll:function(){
if(this.element.scrollTop<this.maxHeight){
	this.element.scrollTop++;
	this.counter++;
}else{
	this.element.scrollTop=0;
	this.counter=0;
}
if(this.counter<this.height){
	this.timer=setTimeout(this.scroll.bind(this),50);
}else{
	this.counter=0;
	this.timer=setTimeout(this.scroll.bind(this),3000);
}
},
stop:function(){
clearTimeout(this.timer);
}
}
var myscroll=new Scroll("gonggaoContent",48);
}

/*暂停函数*/
function Pause(obj,iMinSecond){ 
if (window.eventList==null) window.eventList=new Array(); 
var ind=-1; 
for (var i=0;i<window.eventList.length;i++){ 
if (window.eventList[i]==null) { 
window.eventList[i]=obj; 
ind=i; 
break; 
} 
} 

if (ind==-1){ 
ind=window.eventList.length; 
window.eventList[ind]=obj; 
} 
setTimeout("GoOn(" + ind + ")",iMinSecond); 
} 
/* 继续函数*/ 

function GoOn(ind){ 
var obj=window.eventList[ind]; 
window.eventList[ind]=null; 
if (obj.NextStep) obj.NextStep(); 
else obj(); 
} 

/*改变内页菜单状态*/
function changeMenu(name){
	 if(name=="xidan"){
		document.getElementById('xidanTitleImg').src='../images/xidanTitle_down.jpg';
		document.getElementById('kuanjieTitleImg').src='../images/kuanjieTitle_normal.jpg';
		document.getElementById('xinglongTitleImg').src='../images/xinglongTitle_normal.jpg';
		document.getElementById('shoucheTitleImg').src='../images/shoucheTitle_normal.jpg';
	}
	else if(name=="kuanjie"){
			document.getElementById('xidanTitleImg').src='../images/xidanTitle_normal.jpg';
			document.getElementById('kuanjieTitleImg').src='../images/kuanjieTitle_down.jpg';
			document.getElementById('xinglongTitleImg').src='../images/xinglongTitle_normal.jpg';
			document.getElementById('shoucheTitleImg').src='../images/shoucheTitle_normal.jpg';
	}
	else if(name=="xinglong"){
			document.getElementById('xidanTitleImg').src='../images/xidanTitle_normal.jpg';
			document.getElementById('kuanjieTitleImg').src='../images/kuanjieTitle_normal.jpg';
			document.getElementById('xinglongTitleImg').src='../images/xinglongTitle_down.jpg';
			document.getElementById('shoucheTitleImg').src='../images/shoucheTitle_normal.jpg';
	}
	else if(name=="shouche"){
			document.getElementById('xidanTitleImg').src='../images/xidanTitle_normal.jpg';
			document.getElementById('kuanjieTitleImg').src='../images/kuanjieTitle_normal.jpg';
			document.getElementById('xinglongTitleImg').src='../images/xinglongTitle_normal.jpg';
			document.getElementById('shoucheTitleImg').src='../images/shoucheTitle_down.jpg';
	}
	else if(name=="jewerly"){
			document.getElementById('menu1').src='../images/menu1_down.jpg';
			document.getElementById('menu2').src='../images/menu2_normal.jpg';
			document.getElementById('menu3').src='../images/menu3_normal.jpg';
			document.getElementById('menu4').src='../images/menu4_normal.jpg';
	}
	else if(name=="clock"){
			document.getElementById('menu1').src='../images/menu1_normal.jpg';
			document.getElementById('menu2').src='../images/menu2_down.jpg';
			document.getElementById('menu3').src='../images/menu3_normal.jpg';
			document.getElementById('menu4').src='../images/menu4_normal.jpg';
	}
	else if(name=="camera"){
			document.getElementById('menu1').src='../images/menu1_normal.jpg';
			document.getElementById('menu2').src='../images/menu2_normal.jpg';
			document.getElementById('menu3').src='../images/menu3_down.jpg';
			document.getElementById('menu4').src='../images/menu4_normal.jpg';
	}
	else if(name=="other"){
			document.getElementById('menu1').src='../images/menu1_normal.jpg';
			document.getElementById('menu2').src='../images/menu2_normal.jpg';
			document.getElementById('menu3').src='../images/menu3_normal.jpg';
			document.getElementById('menu4').src='../images/menu4_down.jpg';
	}
	else if(name=="position1"){
			document.getElementById('position1TitleImg').src='../images/job/position1_down.jpg';
			document.getElementById('position2TitleImg').src='../images/job/position2_normal.jpg';
	}
	else if(name=="position2"){
			document.getElementById('position1TitleImg').src='../images/job/position1_normal.jpg';
			document.getElementById('position2TitleImg').src='../images/job/position2_down.jpg';
	}
	else if(name=="minpin"){
			document.getElementById('minpinTitleImg').src='../images/procedure/minpin_down.jpg';
			document.getElementById('carTitleImg').src='../images/procedure/car_normal.jpg';
			document.getElementById('houseTitleImg').src='../images/procedure/house_normal.jpg';
	}
	else if(name=="car"){
			document.getElementById('minpinTitleImg').src='../images/procedure/minpin_normal.jpg';
			document.getElementById('carTitleImg').src='../images/procedure/car_down.jpg';
			document.getElementById('houseTitleImg').src='../images/procedure/house_normal.jpg';
	}
	else if(name=="house"){
			document.getElementById('minpinTitleImg').src='../images/procedure/minpin_normal.jpg';
			document.getElementById('carTitleImg').src='../images/procedure/car_normal.jpg';
			document.getElementById('houseTitleImg').src='../images/procedure/house_down.jpg';
	}
	else if(name=="xidanls"){
			document.getElementById('xidanlsTitleImg').src='../images/xidanTitle_down.jpg';
			document.getElementById('kuanjielsTitleImg').src='../images/kuanjieTitle_normal.jpg';
			document.getElementById('xinglonglsTitleImg').src='../images/xinglongTitle_normal.jpg';
	}
	else if(name=="kuanjiels"){
			document.getElementById('xidanlsTitleImg').src='../images/xidanTitle_normal.jpg';
			document.getElementById('kuanjielsTitleImg').src='../images/kuanjieTitle_down.jpg';
			document.getElementById('xinglonglsTitleImg').src='../images/xinglongTitle_normal.jpg';
	}
	else if(name=="xinglongls"){
			document.getElementById('xidanlsTitleImg').src='../images/xidanTitle_normal.jpg';
			document.getElementById('kuanjielsTitleImg').src='../images/kuanjieTitle_normal.jpg';
			document.getElementById('xinglonglsTitleImg').src='../images/xinglongTitle_down.jpg';
	}
	else if(name=="introduce"){
			document.getElementById('introduceTitleImg').src='../images/introduce/introduce_down.jpg';
			document.getElementById('cultureTitleImg').src='../images/introduce/culture_normal.jpg';
			document.getElementById('knowledgeTitleImg').src='../images/introduce/knowledge_normal.jpg';
	}
	else if(name=="culture"){
			document.getElementById('introduceTitleImg').src='../images/introduce/introduce_normal.jpg';
			document.getElementById('cultureTitleImg').src='../images/introduce/culture_down.jpg';
			document.getElementById('knowledgeTitleImg').src='../images/introduce/knowledge_normal.jpg';
	}
	else if(name=="knowledge"){
			document.getElementById('introduceTitleImg').src='../images/introduce/introduce_normal.jpg';
			document.getElementById('cultureTitleImg').src='../images/introduce/culture_normal.jpg';
			document.getElementById('knowledgeTitleImg').src='../images/introduce/knowledge_down.jpg';
	}
	
}

/*--------------------------对联广告类--------------------------------------*/

function $(element){
	if(arguments.length>1){
		for(var i=0,elements=[],length=arguments.length;i<length;i++)
			elements.push($(arguments[i]));
		return elements;
	}
	if(typeof element=="string")
		return document.getElementById(element);
	else
		return element;
}
Function.prototype.bind=function(object){
	var method=this;
	return function(){
		method.apply(object,arguments);
	}
}
var Class={
	create:function(){
		return function(){
			this.initialize.apply(this,arguments);
		}
	}
}
Object.extend=function(destination,resource){
	for(var property in resource){
		destination[property]=resource[property];	
	}
	return destination;
}

var float_ad=Class.create();
float_ad.prototype={
	initialize:function(id,content,top,left,width){
		document.write('<div id='+id+' style="position:absolute;">'+content+'</div>');
		this.id=$(id);
		this.top=top;
		if(!!left){
			this.id.style.left="30px";	
		}else{
			this.id.style.left=(document.documentElement.clientWidth-width-30)+"px";
			window.onresize=function(){
				this.id.style.left=(document.documentElement.clientWidth-width-30)+"px";
			}.bind(this);
		}
		this.id.style.top=top+"px";
		
		this.interId=setInterval(this.scroll.bind(this),20);
	},
	scroll:function(){
		this.stmnStartPoint = parseInt(this.id.style.top, 10);
		this.stmnEndPoint =document.documentElement.scrollTop+ this.top;
		if(navigator.userAgent.indexOf("Chrome")>0){
			this.stmnEndPoint=document.body.scrollTop+this.top;	
		}
		if ( this.stmnStartPoint != this.stmnEndPoint ) {
				this.stmnScrollAmount = Math.ceil( Math.abs( this.stmnEndPoint - this.stmnStartPoint ) / 15 );
				this.id.style.top = parseInt(this.id.style.top, 10) + ( ( this.stmnEndPoint<this.stmnStartPoint ) ? -this.stmnScrollAmount : this.stmnScrollAmount )+"px";
		}
	}
}








/*-----------------------------------------------------------------*/

