<!-- Begin   (This script protects content and images on the site by disabling right mouse click)
//function non(clic) {
//var msg="Copyright  www.infonewsline.ca";
//if (navigator.appName == 'Netscape' && clic.which==3) {
//alert(msg);
//return false;}
//else
//if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
//alert(msg);
//return false;
//}
//return true;
//}
//document.onmousedown = non;
// End -->


var remove_msg = "Are you sure that you want to Remove this?";

var restore_msg = "Are you sure that you want to Restore this?";

var del_msg = "Are you sure that you want to Delete this?";

var w_msg = "Provincial Winner Management !";


//function which handle all pop up windows 
function popUp4all(URL,width,height,left,top) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+",left ="+left+",top ="+top+"');");
}

//function which handle all pop up windows (WITH SCROOL ON)
function popUp4all_s(URL,width,height,left,top) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+",left ="+left+",top ="+top+"');");
}

//function which handle pop up windows for EVENTS
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=450,left = 100,top = 25');");
}

//function which handle pop up windows for Provincial Winners 
function popUp_w(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400,left = 100,top = 25');");
}

//function which handle pop up windows for Provincial Winners 
function popUp_annual_reg(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=690,height=500,left = 100,top = 25');");
}

//function which handle pop up windows for Event Flayer
function popUp_event_flyer(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=690,height=520,left = 100,top = 25');");
}

//function-2(Not in use) which handle pop up windows for Event Flayer
function popUp_event_flyer2(page,PWidth,PHeight,id) {
 eval("designerwiz"+id+"=window.open('"+page+"','designerwiz1','toolbar=1,scrollbars=1,location=1,status=1,menubars=1,resizable=1,width="+PWidth+",height="+PHeight+"')")
eval;("wiz"+id+".window.moveTo((screen.width/2)-(PWidth/2),(screen.height/2)-(PHeight/2))")
}


//Following arra is used while adding winners from admin side	
	areas_copy = new Array("Agincourt", "Ajax/Pickering", "Brampton", "Carleton Place", "Don Valley", "East York", "Etobicoke", "Hamilton","Kingston","Kitchener/Waterloo","Malvern/Rouge River","Markham","Mississauga","NW2 Family of Schools","Oakville","Ottawa","Peterborough","Scarborough","Six Nations","Toronto","Vaughan/Newmarket","York");
	
// create an array of countries
	var main_areas = new Array("Regional", "Provincial");
	// sort array
	//countries.sort();
	
	// this function alters the states selections based on the countries chosen
	//for the billto side of the form - country and state selection boxes
	function printStates(x)
	{	
	
		var areas
		switch(x)
		{
			// Australia
			case 1:
				areas = new Array("Agincourt", "Ajax/Pickering", "Bramption", "Carleton Place", "Don Valley", "East York", "Etobicoke", "Hamilton","Kingston","Kitchener/Waterloo","Malvern/Rouge River","Markham","Mississauga","NW2 Family of Schools","Oakville","Ottawa","Peterborough","Scarborough","Six Nations","Toronto","Vaughan/Newmarket","York");
				areas.sort();
			break;
			// Canada
			case 2:
				//Array("Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland", "Northwest Territories", "Nova Scotia", "Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan", "Yukon Territory" );
				areas = new Array("Top Three");
				areas.sort();
			break;
												
			default:
				areas = new Array("none");
		}
		// make sure that the options array is empty.
		while(document.winners.area.options.length>areas.length)
		{
			for(i=document.winners.area.options.length;i>=0;i--)
			{
				// setting the value to null erases the array value
				document.winners.area.options[i]=null;
				//document.billto.shipto_state.options[i]=null;
			}
		}
		
		for(i=0;i<areas.length;i++)
		{
			// the new Option object will create a new option tag. The first parameter is the option text, the second is the option value
			document.winners.area.options[i]=new Option(areas[i], areas[i]);
			//document.billto.shipto_state.options[i]=new Option(states[i], states[i]);
		}
	}
	

// create an array of countries
	var age_group = new Array("6", "7","8","9", "10","11","12","13","14","15");
	// sort array
	//countries.sort();
	
	// this function alters the states selections based on the countries chosen
	//for the billto side of the form - country and state selection boxes
	function printAges(x)
	{	
	
		var categories
		switch(x)
		{
			
			case 1:
				categories = new Array("Junior");
				//areas.sort();
			break;
			
			case 2:
				categories = new Array("Junior");
				//areas.sort();
			break;
			case 3:
				categories = new Array("Junior");
				//areas.sort();
			break;
			
			case 4:
				categories = new Array("Senior");
				//areas.sort();
			break;
			
			case 5:
				categories = new Array("Senior");
				//areas.sort();
			break;
			
			case 6:
				categories = new Array("Senior");
				//areas.sort();
			break;
			
			case 7:
				categories = new Array("Senior");
				//areas.sort();
			break;
			
			case 8:
				categories = new Array("Senior");
				//areas.sort();
			break;
			
			case 9:
				categories = new Array("Senior");
				//areas.sort();
			break;
			
			case 10:
				categories = new Array("Senior");
				//areas.sort();
			break;
												
			default:
				categories = new Array("none");
		}
		// make sure that the options array is empty.
		while(document.winners.category.options.length>categories.length)
		{
			for(i=document.winners.category.options.length;i>=0;i--)
			{
				// setting the value to null erases the array value
				document.winners.category.options[i]=null;
				//document.billto.shipto_state.options[i]=null;
			}
		}
		
		for(i=0;i<categories.length;i++)
		{
			// the new Option object will create a new option tag. The first parameter is the option text, the second is the option value
			document.winners.category.options[i]=new Option(categories[i], categories[i]);
			//document.billto.shipto_state.options[i]=new Option(states[i], states[i]);
		}
	}	
	
	
//function to check empty Search Field	
function validate_search(f)
{
	
	//search
	if(f.search.value=="")
	{
		alert("Please Enter Keyword");
		f.search.focus();
		return false;
	}
	
	
}

//function to check empty upload field	
function validate_upload(f)
{
	
	//userfile
	if(f.userfile.value=="")
	{
		alert("Select The Image");
		f.userfile.focus();
		return false;
	}

}	

//function to check empty Winner Information	
function validate_winner(f)
{
	
	//first name
	if(f.first_name.value=="")
	{
		alert("Enter First Name");
		f.first_name.focus();
		return false;
	}
	
	//last name
	if(f.last_name.value=="")
	{
		alert("Enter Last Name");
		f.last_name.focus();
		return false;
	}
	
	//last name
	if(f.age.value=="")
	{
		alert("Select Age");
		f.age.focus();
		return false;
	}

}

function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea"||tempobj.type=="password")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please make sure the "+shortFieldName+" field was properly completed.");
return false;
}
else
return true;
}
//function to check Article Submission First Step
function validate_firststep(f)
{	
	var requiredemail = f.requiredemail.value
   // E-mail address must match the following criteria:
   // starts with a letter or underscore
   // followed by one or more letter, number, underscore, or period
   // followed by single @ symbol
   // followed by at least one letter, number or underscore
   // followed by one or more periods
   // followed by one or more letters
   var chkEmail = /[A-Za-z_]{1,}[\w._]{1,}@{1}[\w]{1,}[.]{1,}/;
	
	//firstname  name
	if(f.requiredfull_name.value=="")
	{
		alert("Enter Your Full Name");
		f.requiredfull_name.focus();
		return false;
	}
	//email
   if(!chkEmail.test(requiredemail)) {
      alert("Please enter a valid e-mail address");
      f.requiredemail.focus();
      return false;
   }     
	//password
	if(f.requiredpassword.value=="")
	{
		alert("Enter Password");
		f.requiredpassword.focus();
		return false;
	}
	//password
	if(f.requiredre_type_password.value=="")
	{
		alert(" Re Type Password");
		f.requiredre_type_password.focus();
		return false;
	}			
	//aboutme
	if(f.requiredagreement.value=="")
	{
		alert("You Must Agree To the Agreement");
		f.requiredagreement.focus();
		return false;
	}	
}
function validate_secondstep(f)
{
//address
	if(f.requiredarticle_title.value=="")
	{
		alert("Enter Article Title");
		f.requiredarticle_title.focus();
		return false;
	}	
	//city
	if(f.requiredcategory.value=="")
	{
		alert("Select Category");
		f.requiredcategory.focus();
		return false;
	}
	
	//state
	if(f.requiredarticle_details.value=="")
	{
		alert("Enter Complete Article");
		f.requiredarticle_details.focus();
		return false;
	}
	
	//country
	if(f.requiredbio.value=="")
	{
		alert("Enter a few words about Yourself");
		f.requiredbio.focus();
		return false;
	}
}
	
//function to check Article Submission First time
function validate_contact(f)
{	
	var requiredemail = f.requiredemail.value
   // E-mail address must match the following criteria:
   // starts with a letter or underscore
   // followed by one or more letter, number, underscore, or period
   // followed by single @ symbol
   // followed by at least one letter, number or underscore
   // followed by one or more periods
   // followed by one or more letters
   var chkEmail = /[A-Za-z_]{1,}[\w._]{1,}@{1}[\w]{1,}[.]{1,}/;
	
	//firstname  name
	if(f.requiredfull_name.value=="")
	{
		alert("Enter Your Full Name");
		f.requiredfull_name.focus();
		return false;
	}
	//email
   if(!chkEmail.test(requiredemail)) {
      alert("Please enter a valid e-mail address");
      f.requiredemail.focus();
      return false;
   }
   //message
	if(f.requiredmessage.value=="")
	{
		alert("Please enter your comments / message.");
		f.requiredmessage.focus();
		return false;
	}	
}	

//function to check Article Submission First Step
function validate_quick_add(f)
{	
	//var requiredemail = f.requiredemail.value
   // E-mail address must match the following criteria:
   // starts with a letter or underscore
   // followed by one or more letter, number, underscore, or period
   // followed by single @ symbol
   // followed by at least one letter, number or underscore
   // followed by one or more periods
   // followed by one or more letters
  // var chkEmail = /[A-Za-z_]{1,}[\w._]{1,}@{1}[\w]{1,}[.]{1,}/;	
	//firstname  name
	if(f.requiredfull_name.value=="")
	{
		alert("Enter Your Full Name");
		f.requiredfull_name.focus();
		return false;
	}
	if(f.requiredemail.value=="")
	{
		alert("Enter Email or Website or Full Name (This Value is very important)");
		f.requiredemail.focus();
		return false;
	}
	//email
   //if(!chkEmail.test(requiredemail)) {
      //alert("Please enter a valid e-mail address");
     // f.requiredemail.focus();
     // return false;
  // }     
	

	if(f.requiredarticle_title.value=="")
	{
		alert("Enter Article Title");
		f.requiredarticle_title.focus();
		return false;
	}	
	//city
	if(f.requiredcategory.value=="")
	{
		alert("Select Category");
		f.requiredcategory.focus();
		return false;
	}
	
	//state
	if(f.requiredarticle_details.value=="")
	{
		alert("Enter Complete Article");
		f.requiredarticle_details.focus();
		return false;
	}
	
	//country
	if(f.requiredbio.value=="")
	{
		alert("Enter Owner's Bio");
		f.requiredbio.focus();
		return false;
	}
}
//function to check Article Submission First Step
function validate_quick_add2(f)
{	
	
	if(f.requiredarticle_title.value=="")
	{
		alert("Enter Article Title");
		f.requiredarticle_title.focus();
		return false;
	}	
	//city
	if(f.requiredcategory.value=="")
	{
		alert("Select Category");
		f.requiredcategory.focus();
		return false;
	}
	
	//state
	if(f.requiredarticle_details.value=="")
	{
		alert("Enter Complete Article");
		f.requiredarticle_details.focus();
		return false;
	}	
	
}