////////////////////////////////////////////////////////////////////////
//	Program Name:		main.js
//	Programmer:			Joseph E Sutton
//	Company:				CiSMS
//	Description:		main functions
//	Date:						10/05/2003
//	Updated:				10/05/2003
//	Copyright:			All rights are reserved by the sole creator and designer.
//									No one may use duplicate of copy and part of this program/file
//									with out the write consent from the owner. Any miss use of 
//									this file or any other files created by the	programmer(Joseph E Sutton)
//									is prohibited by law. And shall be persecuted to the full extent of the law. 
////////////////////////////////////////////////////////////////////////



function Over(a)
{
	a.className = 'side_menu_over';
}

function NotOver(a)
{
	a.className = 'side_menu_notover';
}

function Click(a)
{
//	alert(a);
	document.location = a;
}

function ChangeSytle(sn)
{
	p = document.location;

	temp = new String(p);
	d = "";
	a = temp.split("&");
	//alert(a);
	for(i=0; i < a.length; i++)
	{
		temp = a[i];
		if( temp.search("sn=") == -1)
		{
			d += temp;
		}

		if(i+1 < a.length)
		{
			d += "|";
		}
	}
	document.location = "setstyle.php?sn="+sn+"&return_page="+d;
	
	return true;
}

function Popup(p, s, m)
{
	w = window.screen.width;
	h = window.screen.height-150;
	window.open(p+".php?s="+s+"&m="+m, "model", "height="+h+",width=500,top=0,left=0,menubar=yes,resizable=yes,scrollbars=yes,channelmode=no,fullscreen=no,status=no,toolbar=no,location=no");
}

function GoSearch(p, search)
{
	if( search == null)	search = "search";

	if( search == "adv_search")
	{
		w = document.getElementById("adv_w");
		h = document.getElementById("adv_h");
		d = document.getElementById("adv_d");
		g = document.getElementById("adv_g");
		l = document.getElementById("adv_l");
		
		if(g.checked == true) gl = 1;
		else				  gl = 0;

		s = document.getElementById(search);
		d = p+".php?s="+s.value+"&w="+w.value+"&h="+h.value+"&d="+d.value+"&gl="+gl;

	} else {
		s = document.getElementById(search);
		d = p+".php?s="+s.value;
	}
	
	document.location = d;
	return false;
}

function FindReps()
{
	s = document.getElementById("state_prov");
	d = "reps.php?state_prov="+s.value;
	
	document.location = d;
	return false;
}

