// JavaScript Document
//text sizer

function change_size(whatstyle) {		
	 document.getElementById('button_small').src="images/small.jpg";
	 document.getElementById('button_medium').src="images/medium.jpg";
	 document.getElementById('button_large').src="images/large.jpg";
	 document.getElementById('current_style').href="css/zs_fonts_"+whatstyle+".css";
	// alert(document.getElementById('current_style').href);
	 set_size_button(whatstyle);
}

function set_size_button(new_style) {
 	document.getElementById('button_'+new_style).src="images/"+new_style+"_1.jpg";
}
//drop down refresh
var firstselect;
function resetOptionList(what) {
    if (firstselect=='yes') {
        document.getElementById(what).selectedIndex=0;
        firstselect='no';
    }
    if (document.getElementById(what).selectedIndex!=0) firstselect='yes';
}
//form submission without setting any parameter
function submitForm(aform_name){
		var aform = document.getElementById(aform_name);
		aform.submit();
}
//open links
function openlink(aform_name,url){
	var aform = document.getElementById(aform_name);
	aform.action=url;
	aform.submit();
}
//Mouse Overs effects
function changeImage(obj,url){
	//obj.src="http://"+domain+url;
}
function setTextColor(obj,color){
	obj.style.color=color;
}
function setBackgroundColor(obj,color){
	//alert(obj.style);
	obj.style.backgroundColor=color;	
}
function setBackgroundColorSmart(obj,color){
	//alert(document.all('tempcolor').value);
	document.all('tempcolor').value = obj.style.backgroundColor;
	obj.style.backgroundColor=color;	
}
function setRightBorderColorAndSize(obj,color,size){
	//obj.style.borderStyle="solid";
	//obj.style.borderWidth="1px";
	//obj.style.borderRightColor=color;
}
function setDivHeight(divobj1,divobj2){
	//alert(divobj2.style.height);
	//divobj1.style.top = divobj2.style.height;
}
function setTextSize(obj){
	//alert(obj.style.textTransform);
	obj.style.fontWeight = "bold";
}
function unSetTextSize(obj){
	//alert(obj.style.textTransform);
	obj.style.fontWeight = "normal";
}
function focusAndClearTextBox(obj){
	//alert('good');
	obj.value = "";
	obj.focus();
	//alert('bad');
}
function b_focus(obj, color){
	obj.style.backgroundColor = color;
}
function b_defocus(obj, color){
	obj.style.backgroundColor = color;
}
function select_row_deselect_row(rowtoselect,rowtodeselectid){
	//alert(rowtoselect.id +' '+rowtodeselectid);
	var img=document.all('img'+rowtoselect.id);
	img.style.display= '';
	rowtoselect.style.backgroundColor = '#ebebeb';
	img=document.all('img'+rowtodeselectid);
	img.style.display= 'none';
	//document.all(rowtodeselectid).style.backgroundColor= '#ffffff';
	//document.all('tempcolor').value
	document.all('selectedrowid').value= rowtoselect.id;
	//alert(rowtoselect.style.backgroundColor);
}
function openDiv(obj,divid,message){
	
	/*var adiv=document.all(divid);
	
	adiv.style.position= obj.style.position;
	alert(adiv.style.position);
	adiv.style.left= obj.style.left;
	adiv.style.top= obj.style.top;
	adiv.style.innerHTML= message;
	adiv.style.display= '';
	alert('2');*/
}
function closeDiv(obj,divid,message){
	/*alert('1');
	var adiv=document.all(divid);
	adiv.style.display= 'none';
	alert('2');*/
}
function openNewWindow(link,file){
	window.open(file,link.title,"menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,width=520,height=650,left=10,top=10");
}