function MM_findObj(n, d) { 
	var p,i,x;  
	if(!d)d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length){
		d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all)x=d.all[n]; 
	for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
  	if(!x && document.getElementById)x=document.getElementById(n); 
	return x;
}

function turnDiv(d){
	tmpObject=MM_findObj(d);
	if(tmpObject.style.display=='none'){
		tmpObject.style.display='';
	} else {
		tmpObject.style.display='none';
	}
}

function turnDivOn(d){
	tmpObject=MM_findObj(d);
	tmpObject.style.display='';
}

function turnDivOff(d){
	tmpObject=MM_findObj(d);
	tmpObject.style.display='none';
}

function bigpicview(piclink, width, height){
	x=(screen.width-width)/2;
	y=(screen.height-height)/2;
	window.open('/picview.php?pic='+piclink, 'bpv', 'width='+width+', height='+height+', left='+x+', top='+y+', resizeable=0, scrollbars=0');
}

function changeClass(ele,cls){
	row.className=cls;
}

function changeRowClass(ele,cls){
	row=document.getElementById(ele);
	row.className=cls;
}

function js_in_array(a,v){
	for(js_in_i=0;js_in_i<a.length;js_in_i++){
		if(a[js_in_i]==v)return true;
	}
	return false;
}

