// JavaScript Document

<!--- CHANGE IMAGES FOR ROLLOVERS --->

function changeImages() {
	var isNetscape = navigator.appName == "Netscape";

	if (isNetscape) {
		if (document.images) {
		 for (var i = 0; i < changeImages.arguments.length; i += 2) {
				document[changeImages.arguments[i]].src = eval(changeImages.arguments[i + 1] + ".src");
		 }
		}
	} else {
		for (var i = 0; i < arguments.length; i += 2){
			document.images[arguments[i]].src = eval(arguments[i + 1] + ".src");
		}
	}
}

function setMsg(msg) {
        window.status = msg
        return true
}

<!--- PRELOAD MOUSEOVERS --->

button_photoalbum1 = new Image();
button_photoalbum1.src = "http://coretags.clubwebsource.com/images_general/button_photoalbum1.gif";
button_photoalbum2 = new Image();
button_photoalbum2.src = "http://coretags.clubwebsource.com/images_general/button_photoalbum2.gif";

video_iconbutton1 = new Image();
video_iconbutton1.src = "http://coretags.clubwebsource.com/images_general/video_iconbutton1.gif";
video_iconbutton2 = new Image();
video_iconbutton2.src = "http://coretags.clubwebsource.com/images_general/video_iconbutton2.gif";

button_additionalpages1 = new Image();
button_additionalpages1.src = "http://coretags.clubwebsource.com/images_general/button_additionalpages1.gif";
button_additionalpages2 = new Image();
button_additionalpages2.src = "http://coretags.clubwebsource.com/images_general/button_additionalpages2.gif";

<!--- SHOW WINDOW --->
	
<!--
 var win;
  function showWINDOW(url,x,y,x_cord,y_cord) {
	if(x_cord==null || y_cord==null){
		x_cord = 25;
		y_cord = 25;
	}  
	if(x==null || y==null){
		x = 657;
		y = 430;
	}
	var str = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+x+",height="+y+""; 
	var z = parseFloat(navigator.appVersion);
	
	win = window.open(url, "win", str);
	//win.moveTo(x_cord,y_cord);
	
	if (navigator.appName.substring(0.8) == "Netscape" || z > 4){
		this.win.focus();
	}
 }
//-->


<!--- DATE SELECTOR --->

<!--

function AddString(EditControl, StrToAdd)
{
	var CurStr;
	var StrToFind;


	// If just a null string, then clear the edit field
	if (StrToAdd.length == 0)
	{
		EditControl.value = "";
		return;
	}

	// Get the current string and surrounds with commas so we
	// can see if the desired string is already present
	CurStr = "," + EditControl.value + ",";
	StrToFind = "," + StrToAdd + ",";

	// Search
	if (CurStr.indexOf(StrToFind) >= 0)
		// The string is already in the edit field, so just exit now
		return;

	// Append the string
	// If empty string, then just set
	if (CurStr.length == 2)
		EditControl.value = StrToAdd;
	else
		EditControl.value = EditControl.value + "," + StrToAdd;

}  // AddString()



// Values for Method:  0=relative,  1=absolute,  2=relative month,  3=this month
function SelectDates(Offset_Start, Offset_End, Method)
{
	StartDate = new Date();
	EndDate = new Date();

	// exit immediately if a date is already selected
	// (so that if the page is just being reloaded we don't destroy
	// the user's prior selections)
	if (Method == 1)
		if (document.FrmMain.sm.selectedIndex > 0)
			return;

	// Relative, or absolute (days)
	if (Method <= 1)
	{
		// start date
		StartDate.setTime(StartDate.getTime() + (60*60*24*1000*Offset_Start));
		document.FrmMain.sm.selectedIndex = StartDate.getMonth() + 1;
		document.FrmMain.sd.selectedIndex = StartDate.getDate() - 1;
		document.FrmMain.sy.selectedIndex = StartDate.getFullYear() - 1995;

		// end date
		EndDate.setTime(EndDate.getTime() + (60*60*24*1000*Offset_End));
		document.FrmMain.em.selectedIndex = EndDate.getMonth() + 1;
		document.FrmMain.ed.selectedIndex = EndDate.getDate() - 1;
		document.FrmMain.ey.selectedIndex = EndDate.getFullYear() - 1995;
	}

	// Relative month
	if (Method == 2)
	{
		// start date
		StartDate.setDate(1);
		StartDate.setMonth( StartDate.getMonth() + Offset_Start );
		document.FrmMain.sm.selectedIndex = StartDate.getMonth() + 1;
		document.FrmMain.sd.selectedIndex = StartDate.getDate() - 1;
		document.FrmMain.sy.selectedIndex = StartDate.getFullYear() - 1995;

		// end date
		EndDate.setDate(1);
		EndDate.setMonth( EndDate.getMonth() + Offset_End + 1);
		EndDate.setTime(EndDate.getTime() - (60*60*24*1000));
		document.FrmMain.em.selectedIndex = EndDate.getMonth() + 1;
		document.FrmMain.ed.selectedIndex = EndDate.getDate() - 1;
		document.FrmMain.ey.selectedIndex = EndDate.getFullYear() - 1995;
	}

	// This month so far
	if (Method == 3)
	{
		// start date
		StartDate.setDate(1);
		document.FrmMain.sm.selectedIndex = StartDate.getMonth() + 1;
		document.FrmMain.sd.selectedIndex = StartDate.getDate() - 1;
		document.FrmMain.sy.selectedIndex = StartDate.getFullYear() - 1995;

		// end date
		document.FrmMain.em.selectedIndex = EndDate.getMonth() + 1;
		document.FrmMain.ed.selectedIndex = EndDate.getDate() - 1;
		document.FrmMain.ey.selectedIndex = EndDate.getFullYear() - 1995;
	}

	// if start=end, then turn off the "Daily Totals" and "Hits Per Day of Week"
	// reports, since they are kinda useless just for one day
	ReportsBool = 1
	if (document.FrmMain.sm.selectedIndex == document.FrmMain.em.selectedIndex)
		if (document.FrmMain.sd.selectedIndex == document.FrmMain.ed.selectedIndex)
			if (document.FrmMain.sy.selectedIndex == document.FrmMain.ey.selectedIndex)
			{
				ReportsBool = 0
			}
	

}  // SelectDates()



function SelectRelativeDates(Offset_Start, Offset_End) {

	// start date
	ChangeDate = new Date(	document.FrmMain.sy.selectedIndex + 1995, 
				document.FrmMain.sm.selectedIndex - 1,
				document.FrmMain.sd.selectedIndex + 1);
	ChangeDate.setTime(ChangeDate.getTime() + (60*60*24*1000*Offset_Start));
	document.FrmMain.sm.selectedIndex = ChangeDate.getMonth() + 1;
	document.FrmMain.sd.selectedIndex = ChangeDate.getDate() - 1;
	document.FrmMain.sy.selectedIndex = ChangeDate.getFullYear() - 1995;

	// end date
	ChangeDate = new Date(	document.FrmMain.ey.selectedIndex + 1995, 
				document.FrmMain.em.selectedIndex - 1,
				document.FrmMain.ed.selectedIndex + 1);
	ChangeDate.setTime(ChangeDate.getTime() + (60*60*24*1000*Offset_End));
	document.FrmMain.em.selectedIndex = ChangeDate.getMonth() + 1;
	document.FrmMain.ed.selectedIndex = ChangeDate.getDate() - 1;
	document.FrmMain.ey.selectedIndex = ChangeDate.getFullYear() - 1995;

} // SelectRelativeDates()

//-->

<!--
function checkAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}
// -->


// JSCheck Script
	//if( !checkField(1,obj.fieldName,"Please do whatever you are supposed to") ) {return false;}
	//1. text field
	//2. select box
	//3. checkbox or radio
	function checkField(typ,fld,msg) {
		switch ( typ ) {
			case 1:
				if ( !fld.value.length ) {
					alert(msg)
					fld.focus()
					return false;
				}
			break;
			case 2:
				if ( !fld.selectedIndex ) {
					alert(msg)
					fld.focus()
					return false;
				}
			break;
			case 3:
				isChecked = false;
				for ( iCount=0;iCount<fld.length;iCount++) {
					if ( fld[iCount].checked ) {
						isChecked = true;
						return true;
					}
				}
				if ( !isChecked ) {
					alert(msg)
					fld[0].focus()
					return false;
				}
			default:
				alert('Unknown Data Type')
				fld.focus();
				return false;
		}		
		return true;
	}

// Field restriction tools
//syntax = onkeyup="valid(this,'special')" onblur="valid(this,'special')"
	var r={
	  'special':/[^\w]/g, //special allows only numbers and alpha
	  'special2':/[^\w\,\_\.]/g, //special2 allows only numbers and alpha,underscore and comma
	  'quotes':/['\'\`\"']/g, //quotes allows everything except ',",`
	  'passwords':/[^\w\,\_\!\@\$\?\~]/g, //passwords allows only numbers and alpha,underscore and comma
	  'passwordsnocomma':/[^\w\_\!\@\$\?\~]/g, //passwordsnocomma allows only numbers and alpha,underscore
	  'names':/[^\w\,\s]/g, //names allows only numbers,alpha,spaces and commas
	  'namesnocomma':/[^\w\s]/g, //namesnocomma allows only numbers,alpha and spaces
	  'domainalias':/[^\w\s\.\_]/g, //domainalias allows only numbers,alpha,spaces,period and underscore
	  'allownumbers':/[^\d]/g, //allownumbers allows only numbers
	  'allowtime':/[^\d\:]/g, //allownumbers allows only numbers and colons
	  'allowspace':/[^\w\s]/g, //allowspace allows only space and underscore
	  'allowemailwithcomma':/[^\w\@\-\,\.]/g, //allowemailwithcomma allows only numbers,alpha,@,underscore,comma and period
	  'allowemail':/[^\w\@\-\.]/g, //allowemail allows only numbers,alpha,@,underscore,hyphen and period
	  'allowurl':/[^\w\.\-\/]/g //allowemail allows only numbers,alpha,underscore,hyphen and period
	}
	
	function valid(o,w){
	  o.value = o.value.replace(r[w],'');
	}

