var d = document;
var local_eid;
dom = (document.getElementById)? true : false;
nn4 = (document.layers)? true : false;
ie4 = (document.all && !dom)? true : false;
opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;

function mix_desc(eid){
    if(eid ){
		
	if(dom){obj = document.getElementById('md'+eid); iobj = document.getElementById('i'+eid);
		}else if(ie4){obj = document.all['md'+eid];	iobj = document.all['i'+eid];	
		}else if(nn4){obj = document.layers['md'+eid]; iobj = document.layers['i'+eid];}
    }

    if(obj.className=="desc1"){ obj.className="desc0"; iobj.src = '/i/icons/open1.gif';
    }else{ obj.className="desc1"; iobj.src = '/i/icons/open0.gif';}

}

function bg_set(eid, color){if(!color) color = "#F9F9ED";	eid.style.backgroundColor=color;}
function bg_reset(eid, color){eid.style.backgroundColor="";}
function bg_mn(eid){eid.style.backgroundColor = "#A6B9CB";}
function bg_umn(eid){eid.style.backgroundColor = "";}
function bg_hi_artist(eid, color){if(!color) color = "#F9F9ED";	eid.style.backgroundColor=color;eid.style.color ="black"}

function light_photo(eid, t){
	if(!eid) return false;
	obj = document.getElementById(eid);
	if(t == 1)	obj.style.backgroundColor = "#FFFFFF";
	else  obj.style.backgroundColor = "";
}
/*
function light_news(eid, t){//alert(1);
	if(!eid) return false;
	//alert(eid); return false;
	obj = document.getElementById(eid);
	if(t == 1){	//eid.className = "news-line-light";
	obj.style.color="#313129";
	}else{  //eid.className = "";
	obj.style.color="";
	}
} */

function light_menu(eid, type){
    if(type==1){
		if(eid){
		if(dom){		obj = document.getElementById(eid);
		}else if(ie4){	obj = document.all[eid];
		}else if(nn4){	document.layers[eid].bgColor="#F9F9ED";}
		}

		obj.style.backgroundColor="#F9F9ED";
    }else if(!type){
		if(eid){
		if(dom){		obj = document.getElementById(eid);
		}else if(ie4){	obj = document.all[eid];
		}else if(nn4){	document.layers[eid].bgColor="";}
		}
		obj.style.backgroundColor="";
    }

}

function openWindow(theURL,winName, w, h) {
	if(w>0)	width =w; else width = screen.width*0.9;
	if(h>0)	height = h; else height = screen.height*0.8;

	l=(screen.width -width)/2;
	t=(screen.height -height)/2.2;
	window.open(theURL,"windowA","left="+l+",top="+t+",height="+height+",width="+width+",status=no,menubar=no,toolbar=no,scrollbars=yes");
}

function mn_form_hide () {
	var elem = document.getElementById("formlayer");
	if ( elem == null ) return;
	elem.style.visibility = "hidden";
	if ( formframe.document.body ) formframe.document.body.innerHTML = "";
	mn_isform = false;
}
	
function mn_form_show ( src ) {
	//var DivRef=document.getElementById("formframe2");
	var IfrRef=document.getElementById("formframe");
	var elem=document.getElementById("formlayer");

	posy=document.body.scrollTop;
	elem.style.top=posy;
	elem.style.left=0;
	IfrRef.style.width=250;
	IfrRef.style.height=150;
	
	if ( elem == null ) return;
	
	if(src != null){
		document.getElementById("formframe").src = src;
	}else{
		IfrRef.style.visibility = 'hidden';
	}
	elem.style.visibility = 'visible';
	mn_isform = true;
}

function toggleDisplay(div,iframe) {//alert "!";

	var DivRef=document.getElementById(div);
	if (DivRef.style.display!='none') return

	var IfrRef=document.getElementById(iframe);
	var posx=100;
	var posy=100;

	if (document.body.offsetWidth && document.body.offsetHeight) {
		posx=(document.body.offsetWidth-300)/2;
		posy=(document.body.offsetHeight-372)/2+document.body.scrollTop;
		}
	if (window.innerWidth && window.innerHeight) {
		posx=(window.innerWidth-300)/2;
		posy=(window.innerHeight-372)/2+document.body.scrollTop;
		}

	iframe=false;
	if (navigator.appName=='Microsoft Internet Explorer') if (verNumIE()>5) iframe=true;
	if (navigator.appName=='Netscape' && parseInt(navigator.appVersion)>4) iframe=true;

	DivRef.style.top=posy;
	DivRef.style.left=posx;

	if (iframe) {
		IfrRef.style.top=posy;
		IfrRef.style.left=posx;
		}

    DivRef.style.display='block';
	if (iframe) {
	    IfrRef.style.width=DivRef.offsetWidth;
    	IfrRef.style.height=DivRef.offsetHeight;
		IfrRef.style.zIndex=DivRef.style.zIndex-1;
		IfrRef.style.display='block';
		}
	}
	
function subscribe_email(fl) {
	em = document.subscribe.email.value;
	mn_form_show('about:blank');
	if(fl==1) document.subscribe.submit();
}

function djdetils(eid){
	if(eid == local_eid) return false;

	for(i=1; i<5; i++){
		if(dom){	  elem = document.getElementById("data"+i); elem_tools = document.getElementById("tools"+i);//alert("1");
		}else if(ie4){elem = document.all["data"+i]; elem_tools = all["tools"+i] ;
		}//else if(nn4){elem = document.layers["data"+i];} elem_tools = document.layers["tools"+i];
		/*elem = new makeObj("data"+i);
		elem_tools = new makeObj("tools"+i);*/
		if(elem) elem.className="hide";
		if(elem_tools) elem_tools.className="na";
	}
	
	if(dom){	  elem = document.getElementById("data"+eid); elem_tools = document.getElementById("tools"+eid);
	}else if(ie4){elem = document.all["data"+eid]; elem_tools = document.all["tools"+eid];
	}//else if(nn4){elem = document.layers["data"+eid];} elem_tools = document.layers["tools"+eid];
	/*elem = new makeObj("data"+eid);
	elem_tools = new makeObj("tools"+eid);*/
	if(elem) elem.className="show"; 
	if(elem_tools) elem_tools.className="act";
	
	local_eid = eid;
}

function makeObj(obj)
{
	this.elem = document.getElementById(obj);
   	this.css = this.elem ? this.elem.style : null;
	return this;
}

function show_dj_img(id, w, h){
	theURL = "/dj_img/"+id+"/";
	if(w>0)	width =w+80; else width = screen.width*0.9;
	if(h>0)	height = h+80; else height = screen.height*0.8;

	l=(screen.width -width)/2;
	t=(screen.height -height)/2.2;
	window.open(theURL,"windowA","left="+l+",top="+t+",height="+height+",width="+width+",status=no,menubar=no,toolbar=no,scrollbars=no");
}