<!--

//use OnClick="submitFormCategory([Put ID here]);" to enforce form submittal on click. [LX]
//also set the value of the select list to filter the form..
function submitFormCategory(id)
{
		var x = document.getElementById('jobSrch');
		var job_category_id = document.getElementById('Category');
		var Store = document.getElementById('Store');
		var job_type = document.getElementById('job_type');
		var job_duration = document.getElementById('job_duration');
		

		job_category_id.value = id
//		job_category_id.options[id].selected = true;
		Store.options[0].selected = true;
		job_type.options[0].selected = true;
		job_duration.options[0].selected = true;
		x.submit();
}

function submitFormStore(id)
{
		var x = document.getElementById('jobSrch');
		var job_category_id = document.getElementById('Category');
		var Store = document.getElementById('Store');
		var ftOrPt = document.getElementById('ftOrPt');
		var permTemp = document.getElementById('permTemp');

		Store.value = id
//		Store.options[id].selected = true;
		job_category_id.options[0].selected = true;
		ftOrPt.options[0].selected = true;
		permTemp.options[0].selected = true;
		x.submit();
}


function formAction(action)
//sets the action tag to the passed in variable
{
		var x = document.getElementById('search_form');
		x.action = action
}

function changeInputName(name)
//changes the INPUT NAME to the passed in variable
{
		var x = document.getElementById('search_form');
		var AZelement = document.getElementById('AZ');
		AZelement.name = name;
		
//		alert('input name is :  ' + AZelement.name);
}

function DoSearch(bit)
//changes the input "DoSearch" to either 1 or zero
//pass only 1 or 0 into this function to set DoSearch to true or false
{
		var x = document.getElementById('search_form');
		var DoSearchElement = document.getElementById('DoSearch');

		DoSearchElement.value = bit -0; //Force it to subtract zero making it an int..
		
		//alert('will the search appear? :  ' + DoSearchElement.value);
}

function submitSearch(AZ)
//submits the search.asp & search.htm pages
//passing a string in the form Uppercase "X-X"
{
		var x = document.getElementById('search_form');
		var AZelement = document.getElementById('AZ');

		AZelement.value = AZ;
	//	AZelement.style = '"background-color: transparent;background-image: url(/site/gfx/search_nav_buttonalpha_over.png);background-repeat: no-repeat;background-attachment: scroll;color: rgb(18, 119, 181);"';

		//alert('hidden form field value is ' + AZelement.value);
		//alert('form will redirect to :  ' + x.action);
		//AZelement.className='Test';
		x.submit();
		//identity=document.getElementById(id);

 		
}
//function swapClass(id, newClass) {

//var x = document.getElementById(id);
//alert (x)
//x.className=newClass;
//alert(x.ClassName)
//}

function submitSearchcatID(id, name)
//submits the search.asp & search.htm pages
//passing an integer in the form 1
//additionally we pass the CATEGORY NAME for the srch breadcrumb.
{
		var x = document.getElementById('search_form');
		var categoryIDelement = document.getElementById('categoryID');
		var category_name = document.getElementById('category_name');

		categoryIDelement.value = id -0; //Force it to subtract zero making it an int..
		category_name.value = name;
		
		//alert('form will redirect to :  ' + x.action);
		//alert('the value of categoryIDelement is ' + categoryIDelement.value);
		x.submit();
}

function setSubRetailerCategoryID(id)
//changes the subcategory id to its correct value from the recordset.
{
		var subCategoryIDelement = document.getElementById('subCategoryID');

		subCategoryIDelement.value = id -0; //Force it to subtract zero making it an int..

		//alert('the value of subCategoryID is ' + subCategoryIDelement.value);

}

/* Keyword search related */
function clearKeywords(keywords)
{
	
	if (keywords.value=='enter text here') 
	{	
		keywords.value='';
	}
}


function checkKeywordsNotNull()
{
	if (document.search_form_keyword.keywords.value=='' || document.search_form_keyword.keywords.value=='enter text here')  
	{
		window.alert('Please enter one or more keywords');
		return false;
	}
	else
	{
		return true;
	}
}



function popupWin(width, height, url)
{

	var intScWidth,intScHeight,intXPos,intYPos;
	
	intScWidth = screen.availWidth;
	intScHeight = screen.availHeight;
	
	intXPos = ((intScWidth - width) / 2);
	intYPos = ((intScHeight - height) / 2);

	var features = "height="+height+",width="+width+",screenX=" + intXPos + ",screenY=" + intYPos + ",left=" + intXPos + ",top=" + intYPos + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes";
	window.open(url, null, features);
}

function popupDrawsheetWin(width, height, url)
{
	//alert(url);

	var intScWidth,intScHeight,intXPos,intYPos;
	
	intScWidth = screen.availWidth;
	intScHeight = screen.availHeight;
	
	intXPos = ((intScWidth - width) / 2);
	intYPos = ((intScHeight - height) / 2);

	var features = "height="+height+",width="+width+",screenX=" + intXPos + ",screenY=" + intYPos + ",left=" + intXPos + ",top=" + intYPos + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes";

	var drawwin = window.open(url, "drawwin", features);
	drawwin.focus();
}

function popupPlayerWin(width, height, url)
{
	//alert(url);

	var intScWidth,intScHeight,intXPos,intYPos;
	
	intScWidth = screen.availWidth;
	intScHeight = screen.availHeight;
	
	intXPos = ((intScWidth - width) / 2);
	intYPos = ((intScHeight - height) / 2);

	var features = "height="+height+",width="+width+",screenX=" + intXPos + ",screenY=" + intYPos + ",left=" + intXPos + ",top=" + intYPos + ",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes";

	var playerwin = window.open(url, "playerwin", features);
	playerwin.focus();
}


function handleRegisterForm()
{
	var strMsg = 'Please correct the following...\n---------------------------------------\n';
	var blnCanSubmit = true;

	var frm_register = document.frm_register;
	
	var txt_firstName = document.getElementById('first_name');
	var txt_lastName = document.getElementById('last_name');
	var txt_email = document.getElementById('user_email');
	var chk_terms = document.getElementById('chk_terms');	
		
	var strPleaseCorrectColour = '42A6CC';
	var strOKColour = 'ffffff';

	setBGColour(txt_firstName,strOKColour);
	if(txt_firstName.value == '')
	{
		setBGColour(txt_firstName,strPleaseCorrectColour);
		blnCanSubmit = false;
		strMsg += 'Please enter your First Name.\n';
	}

	setBGColour(txt_lastName,strOKColour);
	if(txt_lastName.value == '')
	{
		setBGColour(txt_lastName,strPleaseCorrectColour);
		blnCanSubmit = false;
		strMsg += 'Please enter your Last Name.\n';
	}

	setBGColour(txt_email,strOKColour);
	if(txt_email.value == '')
	{
		setBGColour(txt_email,strPleaseCorrectColour);
		blnCanSubmit = false;
		strMsg += 'Please enter your email address.\n';
	}
	else
	{
		if(!emailCheck(txt_email.value))
		{
			setBGColour(txt_email,strPleaseCorrectColour);
			blnCanSubmit = false;
			strMsg += 'Please enter a valid email address.\n';	
		}
	}

	setBGColour(chk_terms,strOKColour);
	if(!chk_terms.checked)
	{
		setBGColour(chk_terms,strPleaseCorrectColour);
		blnCanSubmit = false;
		strMsg += 'Please tick box to confirm you have read Terms & Conditions.\n';
	}

	if(blnCanSubmit == false)
	{
		alert(strMsg);
	}

	else
	{
		frm_register.submit();
	}
}

function setBGColour(element, colour){

	element.style.backgroundColor = colour;

}



function emailCheck(strEmail) 
{
	var email = strEmail;
	invalidChars = " /:,;"

	if (email == "") {
		return false;
	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
			return false;
		}
	}
	atPos = email.indexOf("@",1)
	if (atPos == -1) {
		return false;
	}
	if (email.indexOf("@",atPos+1) > -1) {
		return false;
	}
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) {
		return false;
	}
	if (periodPos+3 > email.length)	{
		return false;
	}
	return true;
}

function getObj(name){ 
	if (document.getElementById){
		return document.getElementById(name);
	}else if (document.all){
		return document.all[name];
	}else if (document.layers){
		return document.layers[name];
	}
}
function clearSearchBox()
{
	var objBox=getObj("searchtext");
	objBox.value="";
}

var min=8;
var max=22;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   var h1 = document.getElementsByTagName('h1');
   var h2 = document.getElementsByTagName('h2');
   var h3 = document.getElementsByTagName('h3');
   var li = document.getElementsByTagName('li');
   var td = document.getElementsByTagName('td');
   
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
      
   }
   
   for(i=0;i<h1.length;i++) {
      if(h1[i].style.fontSize) {
         var s = parseInt(h1[i].style.fontSize.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=max) {
         s += 1;
      }
      h1[i].style.fontSize = s+"px"
      
   }
   
   
    for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 20;
      }
      if(s!=max) {
         s += 1;
      }
      h2[i].style.fontSize = s+"px"
      
   }
   
   for(i=0;i<h3.length;i++) {
      if(h3[i].style.fontSize) {
         var s = parseInt(h3[i].style.fontSize.replace("px",""));
      } else {
         var s = 20;
      }
      if(s!=max) {
         s += 1;
      }
      h3[i].style.fontSize = s+"px"
      
   } 
   
   
    for(i=0;i<li.length;i++) {
      if(li[i].style.fontSize) {
         var s = parseInt(li[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      li[i].style.fontSize = s+"px"
      
   }
   
   for(i=0;i<td.length;i++) {
      if(td[i].style.fontSize) {
         var s = parseInt(td[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      td[i].style.fontSize = s+"px"
      
   } 
   
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   var h1 = document.getElementsByTagName('h1');
   var h2 = document.getElementsByTagName('h2');
   var h3 = document.getElementsByTagName('h3');
   var li = document.getElementsByTagName('li');
   var td = document.getElementsByTagName('td');
   
   
   
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
   
    for(i=0;i<h1.length;i++) {
      if(h1[i].style.fontSize) {
         var s = parseInt(h1[i].style.fontSize.replace("px",""));
      } else {
         var s = 18;
      }
      if(s!=min) {
         s -= 1;
      }
      h1[i].style.fontSize = s+"px"
      
   }
   
   
    for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 20;
      }
      if(s!=min) {
         s -= 1;
      }
      h2[i].style.fontSize = s+"px"
      
   }
   
   for(i=0;i<h3.length;i++) {
      if(h3[i].style.fontSize) {
         var s = parseInt(h3[i].style.fontSize.replace("px",""));
      } else {
         var s = 16;
      }
      if(s!=min) {
         s -= 1;
      }
      h3[i].style.fontSize = s+"px"
      
   } 
   
   
    for(i=0;i<li.length;i++) {
      if(li[i].style.fontSize) {
         var s = parseInt(li[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      li[i].style.fontSize = s+"px"
      
   }
   
   for(i=0;i<td.length;i++) {
      if(td[i].style.fontSize) {
         var s = parseInt(td[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      td[i].style.fontSize = s+"px"
      
   } 
   
   
}

-->