function showPlayer(url)
{
	var win = window.open(url, "rteplayer", "height=560,width=860,status=yes,toolbar=no,menubar=no,location=no");
	win.focus();
}


function PrintPreview()
{
	var win = window.open();
	win.document.write("<html>");
	win.document.write("<head>");	
	win.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/motors/style/print.css\" />");
	win.document.write("</head>");
	win.document.write("<body>");	
	win.document.write("<img src=\"/motors/images/logo_printable_rte.gif\">\n");	
	win.document.write("<hr>");		
	win.document.write(document.getElementById("primaryContent").innerHTML);
	win.document.write("<p><strong>Story from RT&Eacute; News:<br />"+document.location+"</strong></p>");
	win.document.write("</body>");
	win.document.write("</html>");	
	win.document.close();
}


function CheckJobCategoriesIrishJobsSearch()
{

	if(document.MAIN.Category.options[0].selected == true)
	{
		for (var i = 1 ; i < document.MAIN.Category.options.length;i++)
		{
			document.MAIN.Category.options[i].selected=false;
		}
	}
	return false;
}

function CheckLocationIrishJobsSearch()
{
	  	if (document.MAIN.cboLocation.selectedIndex>0)
     	{
			var tempArr
			var k=document.MAIN.cboLocation.selectedIndex;
			
			tempArr=document.MAIN.cboLocation.options[k].value.split(",") ;  //split the values

			document.MAIN.Location.value=tempArr[0]; //set the Location
			if (tempArr[1]==0) 
				{document.MAIN.IsProvince.value=0; } //set the province
			else
				{document.MAIN.IsProvince.value=1;}
		   }
}


function doValidationIrishJobsSearch(theForm)
{

	if (!(theForm.Recruiter[0].checked || theForm.Recruiter[1].checked || theForm.Recruiter[2].checked ) )
	{
		document.getElementById("RecruiterRow").style.backgroundColor = "#E21A1C";
		return false;
	}
	if (!(theForm.JobType[0].checked || theForm.JobType[1].checked || theForm.JobType[2].checked ) )
	{
		document.getElementById("JobTypeRow").style.backgroundColor = "#E21A1C";
		return false;
	}

	if ( theForm.Category.value=='' )
	{
		document.getElementById("CategoryRow").style.backgroundColor = "#E21A1C";
		return false;
	}	
	if ( theForm.Location.value=="-1" || theForm.Location.value=="" )
	{
		theForm.Location.value=0;
	}

}

