function g(o){return document.getElementById(o);}
var url = "http://www.cosiolighting.com/";
var title = "佛山市凯西欧灯饰有限公司";
function sethome(){
	if(document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(url);
	}else if(window.sidebar){
		if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}
			catch(e){
				alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
			}
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',url);
	}
}
function addfav(){
	if(document.all){
		 window.external.addFavorite(url,title);
	}else if(window.sidebar){
		window.sidebar.addPanel(title,url, "");
	}
}
function loadimg(){
  var imgname=new Array();
  var img = new Array();
  //要预先加载图片,如果只有一张就可以不用数组
  imgname[0]="skin/mot_bg.jpg";
  imgname[1]="skin/mot_bg1.jpg";
  imgname[2]="skin/mot_bg2.jpg";
  imgname[3]="skin/mov_bg.jpg";
  imgname[4]="skin/mov_bg1.jpg";
  imgname[5]="skin/mov_bg2.jpg";
  //预读图片
  for (i=0;i<=imgname.length-1;i++){
      img[i] = new Image();
      img[i].src = imgname[i];
  }
}
function pgov(piid){
	g('pi'+piid).style.filter='none';
}
function pgot(piid){
	g('pi'+piid).style.filter='gray';
}
function movz(x){
	g('m1').className = 'lot';
	g('m7').className = 'rot';
	for(i = 2;i < 7;i++){
		g('m'+i).className = 'cot';
	}
	g('m'+x).className = 'cov';
	if(x==1){
		g('m'+x).className = 'lov';
	}
	if(x==7){
		g('m'+x).className = 'rov';
	}
	for(i = 1;i < 8;i++){
		g('fm'+i).style.display = 'none';
	}
	g('fm'+x).style.display = '';
}
function hidsmall(cid){
	//g('cpsmall20').style.display = 'none';

	for(var i = 1 ; i<100; i++){
		var obj = g('cpsmall'+i);
		if(obj!=null){
			obj.style.display = 'none';
		}
	}
}

function hidsmall2(){
	if(g('cpsmall_2_20')!= null)
	g('cpsmall_2_20').style.display = 'none';
}


function mov(x){
	g('m1').className = 'lot';
	g('m6').className = 'rot';
	for(i = 2;i < 7;i++){
		g('m'+i).className = 'cot';
	}
	g('m'+x).className = 'cov';
	if(x==1){
		g('m'+x).className = 'lov';
	}
	if(x==7){
		g('m'+x).className = 'rov';
	}
}
function motz(x){
	g('fm'+x).style.display = 'none';
	for(pbi = 1;pbi<10;pbi++){
		if(g('pbc'+pbi)){
			g('pbc'+pbi).className = '';
		}
	}
}
function viewsmall(sid){
	g('cpsmall'+sid).style.display = '';
}


//////
function viewsmall2(sid){
	var obj = g('cpsmall'+sid);
	viewsmall2.prototype.timer = "" ;
	//viewsmall2.timer = setTimeout("hidsmall2()" ,800); // 设置时间
	if(obj!=null){
		//alert('ta!!S');
			var myDiv = g('cpsmall_2_'+sid);
			if(myDiv==null){ //创建
			myDiv=document.createElement("div");
			myDiv.setAttribute("id", "cpsmall_2_"+sid);
			myDiv.setAttribute("class","fmenu");
			myDiv.setAttribute("className","fmenu");

			myDiv.innerHTML=obj.innerHTML;
			
			myDiv.style.position="absolute";
			myDiv.style.top="250px";
			myDiv.style.left="780px";
			
			
			//事件
			myDiv.onmouseout = function(){
				clearTimeout(viewsmall2.timer);
				//myDiv.style = this;
				viewsmall2.timer = setTimeout("hidsmall2()" ,600); // 设置时间
//				myDiv.style.display = 'none';
			}

			myDiv.onmouseover = function(){
				clearTimeout(viewsmall2.timer);
			}


 
			document.body.appendChild(myDiv);
		}

		//
		myDiv.style.display = '';
	}
}
///


function bpcov(x){
	g('pbc'+x).className = 'pbov';
}
function pmov(x,y){
	for(i = 1;i < y;i++){
		g('psm'+i).className = '';
	}
	g('psm'+x).className = 'pmov';
	for(i = 1;i < y;i++){
		g('cpi'+i).style.display = 'none';
	}
	g('cpi'+x).style.display = '';
}
function sameheight(diva,divb,wt){
	if(g(diva).scrollHeight>g(divb).scrollHeight){
		g(divb).style.height=g(diva).scrollHeight+wt+'px'
	}else{
		g(diva).style.height=g(divb).scrollHeight+wt+'px'
	}
}
function indexsameheight(){
	if(g("indexld").scrollHeight > (g("rightrda").scrollHeight + g("rightrdb").scrollHeight + 2)){
		g("rightrdb").style.height = g("indexld").scrollHeight - g("rightrda").scrollHeight - 17 + "px"
	}else{
		g("indexld").style.height = g("rightrda").scrollHeight + g("rightrdb").scrollHeight - 13 + "px"
	}
}
function seth(item,mxh){
	if(g(item).scrollHeight < mxh){
		g(item).style.height=mxh+'px'
	}
}
//图片显示控制
function high(which2){

theobject=which2

highlighting=setInterval("highlightit(theobject)",100)}

function low(which2){clearInterval(highlighting)

which2.filters.alpha.opacity=50}

function highlightit(cur2){

if (cur2.filters.alpha.opacity<200)

cur2.filters.alpha.opacity+=10

else if (window.highlighting)

clearInterval(highlighting)}
