	function validateSearchForm()
	{
		if(document.getElementById('_ctl2_txtPostCode').value == "")
		{
			alert("Please Enter a Post Code");
			document.getElementById('_ctl2_txtPostCode').focus();
			return false;
		}
		else
		{
			return true;
		}

	}



/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Abraham Joffe :: http://www.abrahamjoffe.com.au/ */

/***** CUSTOMIZE THESE VARIABLES *****/

  // width to resize large images to
var maxWidth=100;
  // height to resize large images to
var maxHeight=100;
  // valid file types
var fileTypes=["bmp","gif","png","jpg","jpeg"];
  // the id of the preview image tag
var outImage="previewField";
  // what to display when the image is not valid
var defaultPic="images/spacer.gif";

/***** DO NOT EDIT BELOW *****/

function preview(what){
  var source=what.value;
  var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
  for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
  globalPic=new Image();
  if (i<fileTypes.length) globalPic.src=source;
  else {
    globalPic.src=defaultPic;
    alert("THAT IS NOT A VALID IMAGE\nPlease load an image with an extention of one of the following:\n\n"+fileTypes.join(", "));
  }
  setTimeout("applyChanges()",200);
}
var globalPic;
function applyChanges(){
  var field=document.getElementById(outImage);
  var x=parseInt(globalPic.width);
  var y=parseInt(globalPic.height);
  if (x>maxWidth) {
    y*=maxWidth/x;
    x=maxWidth;
  }
  if (y>maxHeight) {
    x*=maxHeight/y;
    y=maxHeight;
  }
  field.style.display=(x<1 || y<1)?"none":"";
  field.src=globalPic.src;
  field.width=x;
  field.height=y;
}

// JavaScript Document
	//function PopupPic(sPicURL) { 
   //  window.open( "img_popup.aspx?"+sPicURL, "",  
   //  "resizable=yes,HEIGHT=200,WIDTH=200,scrollbars=yes"); 
   //} 
   
  // function isSelected()
  // {
  // var frm = document.form[0];
//		for(i=0; i<frm.length; i++)
//		{ 
	//		if(frm.elements[i].checked == false)        
//			alert("hi");
//		}
  
//}

//### http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
///window.onload=foo;

//or

//window.onload=function(){
//// foo();
 //bar();
// baz();
//}
 function PopupPic(myimage) {
 html = "<HTML><HEAD><TITLE>www.govouchers.com.au</TITLE>" +
  "</HEAD><BODY LEFTMARGIN=0 " +
  "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" +
  "<IMG SRC='" + myimage + "' BORDER=0 NAME=image " +
  "onload='window.resizeTo(document.image.width,document.image.height)'></CENTER>" +
  "</BODY></HTML>";
 popup=window.open
   ('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
 popup.document.open();
 popup.document.write(html);
 popup.document.focus();
 popup.document.close()
 };

   
function FCKeditor_OnComplete( editorInstance )
{
	window.status = editorInstance.Description ;
}

function focusTextBox()
{
 //login page
	if(document.forms[0].txtUsername != null)
	{
	document.forms[0].txtUsername.focus(); 
	}
 //fp page
	if(document.Form1.txtfpEmail != null)
	{
	document.Form1.txtfpEmail.focus(); 
	}
}
function moveOver()  
{
var boxLength = document.Form1.listSuburb.length;
var selectedItem = document.Form1.listSuburb.selectedIndex;
var selectedText = document.Form1.listSuburb.options[selectedItem].text;
var selectedValue = document.Form1.listSuburb.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.Form1.choiceBox.options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
      }
   }
} 
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.Form1.choiceBox.options[boxLength] = newoption;
}
document.Form1.listSuburb.selectedIndex=-1;
}
function removeMe() {
var boxLength = document.Form1.choiceBox.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.Form1.choiceBox.options[i].selected) {
arrSelected[count] = document.Form1.choiceBox.options[i].value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.Form1.choiceBox.options[i].value == arrSelected[x]) {
document.Form1.choiceBox.options[i] = null;
   }
}
boxLength = document.Form1.choiceBox.length;
   }
}
function saveMe() {
var strValues = "";
var boxLength = document.Form1.choiceBox.length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.Form1.choiceBox.options[i].value;
}
else {
strValues = strValues + "," + document.Form1.choiceBox.options[i].value;
}
count++;
   }
}
if (strValues.length == 0) {
alert("You have not made any selections");
}
else {
alert("Here are the values you've selected:\r\n" + strValues);
   }
}

   
  
function AddBookMark()
{
if (navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) >= 4)
{
document.write('<a href=\"#\" onclick=\"javascript:window.external.AddFavorite(location.href,document.title)\">');
document.write('Add goVouchers to Favourites');
}else
{var msg = "Remember to bookmark this page!";
if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
document.write(msg);
}
}



	function printWindow() {
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) window.print();
	}
	
	 var win = null;

	 function newWindow(mypage,myname,w,h,features) {
	 var winl = (screen.width-w)/2;
	 var wint = (screen.height-h)/2;
	 if (winl < 0) winl = 0;
	 if (wint < 0) wint = 0;
	 var settings = 'height=' + h + ',';
	 settings += 'width=' + w + ',';
	 settings += 'top=' + wint + ',';
	 settings += 'left=' + winl + ',';
	 settings += features;
	 win = window.open(mypage,myname,settings);
	 win.window.focus();
	 }
	 
	 
	 
	 function helpPopup(mypage,myname,w,h,page1, page2) {
	 var winl = (screen.width-w)/2;
	 var wint = (screen.height-h)/2;
	 if (winl < 0) winl = 0;
	 if (wint < 0) wint = 0;
	 var settings = 'height=' + h + ',';
	 settings += 'width=' + w + ',';
	 settings += 'top=' + wint + ',';
	 settings += 'left=' + winl + ',';
	 settings += 'scrollbars=yes';
	 win = window.open(mypage,myname,settings);
	 
	 open(page1,'menu')
     open(page2,'main') 
                    
	 win.window.focus();
	 }

//Informational purposes only -
// Variables:

// 750 - width
// 450 - height
// resizable - window can be resized
// scrollbars - window displays the scrollbar on the right
// status - window displays the status bar at the bottom
// toolbar - window displays the toolbar at the top

// Note: href="#null" makes the link display as a link. Don't leave it out!



	
	//function NewWindow(mypage, myname, w, h, scroll) {
	//var winl = (screen.width - w) / 2;
	//var wint = (screen.height - h) / 2;
	//winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	//win = window.open(mypage, myname, winprops)
	//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    //  }

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

function Terms(selected)
{
switch(selected)
{
case "1":
document.Form1.txtTerms.value = "Conditions apply. Must present goVoucher."
break;
case "2":
document.Form1.txtTerms.value = "Not valid with any other offer."
break;
case "3":
document.Form1.txtTerms.value = "Must present goVoucher."
break;
case "4":
document.Form1.txtTerms.value = "Excludes Fri, Sat, Sun & Mon. Not valid with any other offer."
break;
case "5":
document.Form1.txtTerms.value = "One claim per customer a day.Must present goVoucher.Not to be used in conjunction with any other offer"
break;
case "6":
document.Form1.txtTerms.value = "Must present goVoucher. Not to be used in conjunction with any other offer."
break;
}
}

function selectAll(cbList,bSelect) {
  for (var i=0; i < cbList.length; i++) 
    cbList[i].selected = cbList[i].checked = bSelect
}
function close_window() {
		window.close();	
		}
function printWindow() {
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) window.print();
	}
	
		//### Clear text boxes ###
 function clearBox(box) {
	 	 if(box.value==box.defaultValue) {
	 	 	 box.value = "";
	 }
	 }
	 
/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[1]='<a href="customerservice.aspx?pv=contact">Contact goVouchers</a>'
menu1[0]='<a href="customerservice.aspx?pv=faq">FAQ\'s</a>'
menu1[2]='<a href="customerservice.aspx?pv=about">About goVouchers</a>'

var menu2=new Array()
menu2[0]='<a href="designvoucher.aspx">Create New goVoucher</a>'
menu2[1]='<a href="members.aspx?pv=vl">Your Listings</a>'

var menu3=new Array()
menu3[0]='<a href="members.aspx?pv=ud">Personal Details</a>'
menu3[1]='<a href="members.aspx?pv=bd">Business Details</a>'


//Contents for menu 2, and so on
//var menu2=new Array()
//menu2[0]='<a href="http://cnn.com">CNN</a>'
//menu2[1]='<a href="http://msnbc.com">MSNBC</a>'
//menu2[2]='<a href="http://news.bbc.co.uk">BBC News</a>'
		
var menuwidth='160px' //default menu width
var menubgcolor='#ffffff'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

// select all
function copyit(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")
}

//## Focus first form field wizard
function focusWizardField()
{
	if(document.forms[0].txtHeading != null)
	{
		document.forms[0].txtHeading.focus();
	}
	

}
//wizard validate
function viewPage(pageNum, fieldname) 
	{
		theAlert = "";
		if(!fieldname.value)
		{
			
			switch(fieldname.name)
				{
				case "txtHeading":
					theAlert = "Please enter a Title";
				break;
				case "txtTagLine":
					theAlert = "Please enter a Tag Line";
				break;
				
				case "txtDetails1":
					theAlert = "Please enter goVoucher Details";
				break;
				
				case "txtPhone":
					theAlert = "Please enter your Phone Number";
				break;
				}	
			alert(theAlert);
			
			fieldname.focus()
			return false;
		}
		else
		{
			oMP.selectedIndex = pageNum;
			oTS.selectedIndex = pageNum;
			
			try
			{
				switch(pageNum)
				{
					//case 0:
					//document.forms[0].txtHeading.focus();
					//break;
					case 1:
					if(document.forms[0].txtShoutBox1 == null)
						{
							document.forms[0].txtDetails1.focus();
						}
						else
							{
							document.forms[0].txtShoutBox1.focus();
							}
						break;
					
					case 2:
					document.forms[0].txtTagLine.focus();
					break;
					case 3:
					document.forms[0].txtPhone.focus();
					break;
					case 3:
					document.forms[0].txtPhone.focus();
					break;
				}
			}
			catch(e)
			{
			}
			
		
			return true;
			
		}
	}
	
	function backPage(pageNum) 
	{
		oMP.selectedIndex = pageNum;
		oTS.selectedIndex = pageNum;
	}
	
	function pleaseWait()
	{
	 top.consoleRef=window.open('','myconsole',
	  'width=250,height=150'
	   +',menubar=0'
	   +',toolbar=0'
	   +',status=0'
	   +',scrollbars=0'
	   +',resizable=0')
	 top.consoleRef.document.writeln(
	  '<html><head><title>Creating goVoucher</title></head>'
	   +'<body bgcolor=white onLoad=setTimeout(self.close(),5000)>'
	   +'Creating goVoucher!!!!!!!!!!!!!!!!'
	   +'</body></html>'
	 )
	 consoleRef.focus();
	}

	//function elmName(){

  // for(i=0; i<document.forms[0].elements.length; i++){
  // alert(document.forms[0].elements[i].name)
  // }
function copyPersonalDetails()
{
	if(document.getElementById("copydetails").checked == true)
	{
		document.getElementById("txtContactFirstName").value = document.getElementById("txtFirstName").value
		document.getElementById("txtContactLastName").value = document.getElementById("txtLastName").value
		document.getElementById("txtBusinessMobile").value = document.getElementById("txtMobile").value
		document.getElementById("txtBusinessPhone").value = document.getElementById("txtPhone").value
		document.getElementById("txtBusinessFax").value = document.getElementById("txtFax").value
		document.getElementById("txtBusinessEmail").value = document.getElementById("txtEmail").value
	}
	else
	{
		document.getElementById("txtContactFirstName").value = "";
		document.getElementById("txtContactLastName").value = "";
		document.getElementById("txtBusinessMobile").value = "";
		document.getElementById("txtBusinessPhone").value = "";
		document.getElementById("txtBusinessFax").value = "";
		document.getElementById("txtBusinessEmail").value = "";
	}
}



