//MY javascripts

function go_there(url)
{
	location=url;
}

function go_there_in_frame(url,frame)
{
	parent.frames[frame].location.href=url;
}

function go_there_after_confirm(url,msg)
{
	//parent.location=url;
	if (confirm(msg,'test','test')) go_there(url);
}

function go_back()
{
	history.go(-1);
}

function resize_Iframe(frame)
{
	x=750;
	y=top.frames['main'].frames[frame].document.body.scrollHeight; 
	top.frames['main'].frames[frame].resizeTo(x,y);
}

function confirm_selectbox_before_submit(selectbox,msg,before_change)
{
	var txt=before_change.toLowerCase();
    var index=0;
	if (confirm(msg)) 
	{
		this.form.submit();
	} else {
	    for (;index<selectbox.length; index++){
	       if (selectbox[index].text.toLowerCase()==txt){
	        break;
	       }
	    }
	    selectbox.selectedIndex=index;
	}
}

function submit_if_not_empty(form_id,field,msg)
{
	var txt=document.forms[form_id][field].value;
	if (txt=="")
	{
		alert(msg);
	} else {
		document.forms[form_id].submit();
	}
}

function popupImageWindow(url) {
  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function popup_img(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=1,height=1,scrollbars=yes');
return false;
}

function submitonce(theform){
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
			//disable em
			tempobj.disabled=true
		}
	}
}
