var alternateContent = '<p align="center"><br><br>You dont have the latest version of Macromedia Flash Player.<br>'
								+'Why not download and install the latest version now? It will only take a moment.<br>'
								+'<a href="http://get.adobe.com/flashplayer/" target="_blank">Get Flash</a></p>';
function CheckSearch(){
    var success = true;
    if(!validateFields()){
        success = false;
    }
    
    // Check to see if the user has not sneakily combined a name search with the
    // other types of searches
    if ((document.searchForm.company_name.value.length != 0) && (document.searchForm.company_name.value!='TYPE COMPANY NAME')){
        if (checkConflictFields()) {
            resetNameSearch();
            success = false;
        }
    }
    return success;
    
}
function checkConflictFields() {
    var f = document.searchForm;
    var conflicts = false;
    if (f.catid.selectedIndex     != 0) { conflicts = true; }
    if (f.tradeid.selectedIndex          != 0) { conflicts = true; }
    if (f.countyid.selectedIndex              != 0) { conflicts = true; }
    return conflicts;
}
function validateFields(){
    if ((document.searchForm.company_name.value.length != 0) && (document.searchForm.company_name.value!='TYPE COMPANY NAME')){
        return validateName();
    } else if (document.searchForm.catid.selectedIndex != 0) {
        return true;
    } else {
        alert("Please enter either a company name or select a trade.");
        return false;
    }
    return true;
}
/*******************************************************************************
 * Validation for restricting alphabetic ************ ***
 ******************************************************************************/


	
var numb1 = "0123456789";

function res(t,v){
var w = "";
for (i=0; i < t.value.length; i++) {
x = t.value.charAt(i);
if (v.indexOf(x,0) != -1)
w += x;
}
t.value = w;

}

var numb = "0123456789";

function res1(t,v){
	var w = "";
	for (i=0; i < t.value.length; i++) {
	x = t.value.charAt(i);
	if (v.indexOf(x,0) != -1)
	w += x;
	}
	t.value = w;
	addCommas1(w);
	}
	function addCommas1(nStr)
	{
	  nStr += '';
	  x = nStr.split('.');
	  x1 = x[0];
	  x2 = x.length > 1 ? '.' + x[1] : '';
	  var rgx = /(\d+)(\d{3})/;
	  while (rgx.test(x1)) {
	    x1 = x1.replace(rgx, '$1' + ',' + '$2');
	  }
	  document.searchForm.packagevalue.value=  x1 + x2;
	}
	function res2(t,v){
		
	var w = "";
	for (i=0; i < t.value.length; i++) {
		
	x = t.value.charAt(i);
	if (v.indexOf(x,0) != -1)
	w += x;
	}
	t.value = w;
	addCommas(t.value);
	}
	function addCommas(nStr)
	{
	  nStr += '';
	  x = nStr.split('.');
	  x1 = x[0];
	  x2 = x.length > 1 ? '.' + x[1] : '';
	  var rgx = /(\d+)(\d{3})/;
	  while (rgx.test(x1)) {
	    x1 = x1.replace(rgx, '$1' + ',' + '$2');
	  }
	  document.searchForm.insurancecover.value=  x1 + x2;
	}

function formatNumber()
{
var num = new NumberFormat();

num.setInputDecimal('.');

num.setNumber(document.searchForm.packagevalue.value); 

num.setPlaces('0');

num.setCurrencyValue('$');

num.setCurrency(false);

num.setCurrencyPosition(num.LEFT_OUTSIDE);

num.setNegativeFormat(num.PARENTHESIS);

num.setNegativeRed(false);

num.setSeparators(true, ',', ',');

document.searchForm.packagevalue.value = num.toFormatted();
}
 


function formatNumber1()
{
var num = new NumberFormat();

num.setInputDecimal('.');

num.setNumber(document.searchForm.insurancecover.value); 

num.setPlaces('0');

num.setCurrencyValue('$');

num.setCurrency(false);

num.setCurrencyPosition(num.LEFT_OUTSIDE);

num.setNegativeFormat(num.PARENTHESIS);

num.setNegativeRed(false);

num.setSeparators(true, ',', ',');

document.searchForm.insurancecover.value = num.toFormatted();
}
function cleanAllFields1() {
    document.searchForm.catid.selectedIndex     = 0;
    document.searchForm.tradeid.selectedIndex  = 0;
    document.searchForm.countyid.selectedIndex  = 0;
    document.searchForm.packagevalue.value = "";
    document.searchForm.insurance.checked = false;
	document.searchForm.insurancecover.value = "";
    document.searchForm.healthsafety.checked  = false;
    document.searchForm.environment.checked = false;
	document.searchForm.restricttolocal.checked = false;
	if(document.searchForm.nationwide != null)
	document.searchForm.nationwide.checked = false;
	// document.searchForm.keywrds.value = "REFINE YOUR SEARCH BY ENTERING
	// KEYWORDS";
        if(document.getElementById('vm_full')) document.searchForm.vm_full.checked     = false;
        if(document.getElementById('vm_pref')) document.searchForm.vm_pref.checked     = false;
        if(document.getElementById('vm_cons')) document.searchForm.vm_cons.checked     = false;
        if(document.getElementById('vm_all')) document.searchForm.vm_all.checked     = true;
		
}
function validateName() {
    str   = document.searchForm.company_name.value;
    feeld = "Company Name";
    if (checkNameLength()) {
        if (isAlpha(str, feeld)) {
            return true;
        }
    } else {
        return false;
    }
}

function isAlpha( str, feeld ) {
    
    return true;
}
function checkNameLength() {
    if (document.searchForm.company_name.value.length > 0) {
        if (document.searchForm.company_name.value.length < 3) {
            alert("Please enter at least 3 characters for the Company Name");
            return false;
        }
    }

    return true;
}
function resetSelfSearch() {
    var catid = document.searchForm.catid;

    if (catid.selectedIndex == 0) {
        alert('You must make a Trade selection before choosing any of these options.');
			cleanAllFields();
    }

	resetTopSearch();
}
function cleanAllFields() {
    document.searchForm.catid.selectedIndex     = 0;
    document.searchForm.tradeid.selectedIndex  = 0;
    document.searchForm.countyid.selectedIndex  = 0;
    if(document.searchForm.insurance) document.searchForm.insurance.checked      = false;
    if(document.searchForm.insurancecover) document.searchForm.insurancecover.value = "";
    if(document.searchForm.healthsafety) document.searchForm.healthsafety.checked      = false;
    if(document.searchForm.environment) document.searchForm.environment.checked     = false;
    if(document.searchForm.countyid) document.searchForm.countyid.selectedIndex    = 0;
    if(document.searchForm.packagevalue)  document.searchForm.packagevalue.value = "";   
    if(document.searchForm.restricttolocal) document.searchForm.restricttolocal.checked = false;  
  
	
	if(document.searchForm.nationwide != null)
	document.searchForm.nationwide.checked = false;
	// document.searchForm.keywrds.value = "REFINE YOUR SEARCH BY ENTERING
	// KEYWORDS";
        if(document.getElementById('vm_full')) document.searchForm.vm_full.checked     = false;
        if(document.getElementById('vm_pref')) document.searchForm.vm_pref.checked     = false;
        if(document.getElementById('vm_cons')) document.searchForm.vm_cons.checked     = false;
        if(document.getElementById('vm_all')) document.searchForm.vm_all.checked     = true;
}
function setCookie(name, value) {
  	// use: setCookie("name", value);
		var today = new Date();
  	var expiry = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000); // plus
																		// 28
																		// days
    if (value != null && value != "")
      document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
    bikky = document.cookie; // update bikky
  }
	function basicSearch() {

                // if check_company_details has anything in it then overwrite
				// company_name and do the search ..
                var ccd = document.forms['searchForm'].check_company_details.value;
                
                if(ccd != "") {
                    document.forms['searchForm'].company_name.value = ccd;
                }
               

		if(!CheckSearch()) return;
	    var TradeID=document.forms['searchForm'].tradeid.value;
		var CatID=document.forms['searchForm'].catid.value;
		// var SubcatID=document.forms['searchForm'].subcatid.value;
		var CountyID=document.forms['searchForm'].countyid.value;
		var CompName=document.forms['searchForm'].company_name.value;
		var SearchType=0 ;// 0=>Basic; 2=>Advanced; 4=>ByName
			if ((CompName.length>=5) && (CompName!="TYPE COMPANY NAME")) SearchType=4;
		
			
		var URL="hiddenSearch.php?tradeid="+TradeID+"&catid="+CatID+"&countyid="+CountyID+"&searchtype="+SearchType+"&compname="+escape(CompName);
         

		// alert(URL);
		retVal=setSearchCriteria(CatID,TradeID,CountyID,CompName);

		// alert(event);
		// menuLayers.show('wws',event);
		// document.getElementById('IFrame').src=URL;
		window.location=URL;
	}


	function setSearchCriteria(CatID,TradeID,CountyID,CompName)
	{
		// set search criteria as cookie
		if(CatID!='0')
		{
		var Cat='';
		var Trade='';
		var County='';
		var SearchCriteria='';
		if(CatID!='0000')  SearchCriteria=SearchCriteria+document.forms['searchForm'].catid.options[document.forms['searchForm'].catid.selectedIndex].text;
		if(TradeID!='0') SearchCriteria=SearchCriteria+'-'+document.forms['searchForm'].tradeid.options[document.forms['searchForm'].tradeid.selectedIndex].text ;
		if(CountyID!='0')  SearchCriteria=SearchCriteria+' who work in '+document.forms['searchForm'].countyid.options[document.forms['searchForm'].countyid.selectedIndex].text;
		}
		else SearchCriteria='Search for Company: '+CompName;
		// alert(SearchCriteria);
		retVal=setCookie('BRSearchCriteria',SearchCriteria);
		return true;
	}

	

	function kpsearch(event)
	{

		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {

			basicSearch();
			return false;
		}
		else
			return true;
	}
	function clearcont()
	{
		if (document.forms['searchForm'].company_name.value == "TYPE COMPANY NAME") {
			document.forms['searchForm'].company_name.value = "";
			return true;
		}
	}
	function loginvalidation()
	{
// alert(document.LoginForm.username.value);
	     if(document.LoginForm.username.value == ''){
	     alert('please enter username');
		document.LoginForm.username.focus();
		return
		}
		if(document.LoginForm.password.value == ''){
	     alert('please enter password');
		document.LoginForm.password.focus();
		return
		}
		/*
		 * var keyCode = event.keyCode ? event.keyCode : event.which ?
		 * event.which : event.charCode; if (keyCode == 13) {
		 * LoginForm.submit();}
		 */

		document.LoginForm.submit();

	}
	function Click(user)
	{
		if(user.value=="")
		{
			alert("Please enter a valid username");
			return;
		}
		OpenSubWin('email_password.php?user='+user.value,400,200,0);
	}

	function enterkey(event)
		{
			var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
			if (keyCode == 13) {
			loginvalidation();}
		}
	function OpenSubWin( page, w, h, sb )
				{
				    var sw = screen.width, sh = screen.height;
	  				var ulx = ((sw-w)/2), uly = ((sh-h)/2);
	  				var sbt = (sb==1) ? 'yes' : 'no';

	  				var paramz = 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars='+sbt+',width='+w+',height='+h+'';
	  				var oSubWin = window.open( '', 'SubWin', paramz );

	  				oSubWin.moveTo( ulx, uly );
	  				oSubWin.location.replace( page );
				}
	 function jobValue() {
         jval = document.searchForm.packagevalue.value;

         if(jval<1) {
             if(jval!="") {
                 // window.alert("Invalid Job Value please enter a value or
					// leave it blank");
                 document.searchForm.packagevalue.value="";
                 document.searchForm.packagevalue.focus();
             }
         }
     }
	 

	  function getVMFilter()
	  {
	  	VMFilter=999;
	  	if(document.getElementById('vm_full'))
	  	{
	  		var VM_Full=document.forms['searchForm'].vm_full.checked;
			var VM_Pref=document.forms['searchForm'].vm_pref.checked;
			var VM_Cons=document.forms['searchForm'].vm_cons.checked;
			var VM_All=document.forms['searchForm'].vm_all.checked;
			var VMFilter=999; // Full Register by default

			// 1=>Preferred; 3=>Considered; 0=>All Managed
			if((VM_Pref==1) && (VM_Cons==1)) VMFilter=13;
	  		if((VM_Pref==1) && (VM_Cons==0)) VMFilter=1;
	  		if((VM_Pref==0) && (VM_Cons==1)) VMFilter=3;
	  		if(VM_All==1) VMFilter=0;
	  		if(VM_Full ==1) VMFilter=15;
	  	}

	  	return VMFilter;
	  }

		function basicSearch1()
		{
			if(!CheckSearch1()) return;
			if(document.searchForm.insurance.checked)
			{
			if(document.forms['searchForm'].insurancecover.value == '')
			{
			alert("Please enter the value in minimum cover required");
			document.forms['searchForm'].insurancecover.focus();
			return;
			}
			}
		    var TradeID=document.forms['searchForm'].tradeid.value;
			var CatID=document.forms['searchForm'].catid.value;
			var CountyID=document.forms['searchForm'].countyid.value;
			var CompName=document.forms['searchForm'].company_name.value;
			var RestrictToLocal=document.forms['searchForm'].restricttolocal.checked;
			var Nationwide=false;// #RT 928
			var PackageValue=document.forms['searchForm'].packagevalue.value;
			var InsuranceCover=document.forms['searchForm'].insurancecover.value;
			var HealthSafety=document.forms['searchForm'].healthsafety.checked;
			var Environment=document.forms['searchForm'].environment.checked;
			// var ProfOrgURN=document.forms['searchForm'].proforgurn.value;
			var RefineSearch=false;// document.forms['searchForm'].refinesearch.checked;
			var SearchType=2;
			var VMFilter=getVMFilter();
			
			if(CatID == 1 && VMFilter == 15)
			{
				alert('You must make a Trade selection before choosing these options');
				document.forms['searchForm'].vm_full.checked=false;
				document.forms['searchForm'].vm_pref.checked=false;
				document.forms['searchForm'].vm_cons.checked=false;
				document.forms['searchForm'].vm_all.checked=true;
				return;
			}
			if(VMFilter!=999)
			{
				SearchType=6 ;// 0=>Basic; 2=>Advanced; 4=>ByName 6=>VM
			}
			else if ((CompName.length>=5) && (CompName!="TYPE COMPANY NAME"))
			{
				SearchType=4;
			}
			else
			{
				SearchType=2;
			}
			// alert("Trade:"+TradeID+" Cat:"+CatID+" Subcat:"+SubcatID+"
			// County:"+CountyID+" CompName:"+CompName+"
			// Restrict:"+RestrictToLocal+" Nationwide:"+Nationwide+"
			// PackageValue:"+PackageValue+" InsuranceCover:"+InsuranceCover+"
			// HealthSafety:"+HealthSafety+" Environment:"+Environment+"
			// ProfOrgURN:"+ProfOrgURN+" RefineSearch:"+RefineSearch);
			var URL="hiddenSearch.php?tradeid="+TradeID+"&catid="+CatID+"&countyid="+CountyID+"&restricttolocal="+RestrictToLocal+"&nationwide="+Nationwide+"&packagevalue="+PackageValue+"&insurancecover="+InsuranceCover+"&healthsafety="+HealthSafety+"&environment="+Environment+"&refinesearch="+RefineSearch+"&vmfilter="+VMFilter+"&searchtype="+SearchType+"&compname="+escape(CompName);
			// alert(URL);
			retVal=setSearchCriteria(CatID,TradeID,CountyID,CompName);
			// menuLayers.show('wws',event);
			// document.getElementById('IFrame').src=URL;
			 window.location=URL;
		}
		
	 function codename() {

		 if(document.searchForm.insurance.checked)
		 {
		 document.searchForm.insurancecover.disabled=false;

		 }

		 else
		 {
		 document.searchForm.insurancecover.value='';
		 document.searchForm.insurancecover.disabled=true;
		 }
		 }
	 function CheckSearch1(){
		    var success = true;
		    if(!validateFields()){
		        success = false;
		    }
		    
		    // Check to see if the user has not sneakily combined a name search
			// with the
		    // other types of searches
		    if ((document.searchForm.company_name.value.length != 0) && (document.searchForm.company_name.value!='TYPE COMPANY NAME')) {
		        if (checkConflictFields1()) {
		            resetNameSearch();
		            success = false;
		        }
		    }
		    return success;
		    
		}


		/**
		 * A user can either search for a company name in the free text field OR
		 * search by any of the other option but not both. This functions checks
		 * to see if any of the other fields are populated when the company name
		 * field has been filled
		 */
		function checkConflictFields1() {
		    var f = document.searchForm;
		    var conflicts = false;
		    
		    if (f.catid.selectedIndex     != 0) { conflicts = true; }
		    if (f.tradeid.selectedIndex          != 0) { conflicts = true; }
		    if (f.countyid.selectedIndex              != 0) { conflicts = true; }
		    if (f.packagevalue.value.length != 0) { conflicts = true; }
		    if (f.insurancecover.value.length != 0) { conflicts = true; }
		    if (f.healthsafety.checked   == true) { conflicts = true; }
		    if (f.environment.checked  == true) { conflicts = true; }
		    return conflicts;
		}



		function checkRestrictLocal() {
			 if ((document.searchForm.countyid.selectedIndex == 0)&&(document.searchForm.restricttolocal.checked == true)) {
		        alert("Please select a county first.");
				document.searchForm.restricttolocal.checked = false;
		        return false;
			 }
			if (document.searchForm.restricttolocal.checked == true)
			{
				if(document.searchForm.nationwide != null)
				document.searchForm.nationwide.checked = false;
			}
		}
		function resetSelfSearch1() {
		    var catid = document.searchForm.catid;
		    var county_id=document.searchForm.countyid;
		    var restrict_local=document.searchForm.restricttolocal;
            
		    if (catid.selectedIndex == 0) {
		        alert('You must make a Trade selection before choosing any of these options.');
				cleanAllFields();
		    }
		    if(county_id.value==0) {
		    	restrict_local.checked     =false;
		    }
		    if(county_id.value>0) {
		    if(document.searchForm.nationwide != null)
		    document.searchForm.nationwide.checked =false;
		    }
		    	

			resetTopSearch();
		}
		function resetNameSearch() {
		    var name  = document.searchForm.company_name;

		    if ( name.value > "" ) {
		        alert('You cannot combine this search with a Company Name search')
		        if(document.searchForm.insurance) document.searchForm.insurance.checked      = false;
		        if(document.searchForm.healthsafety) document.searchForm.healthsafety.checked      = false;
		        if(document.searchForm.environment) document.searchForm.environment.checked     = false;
		        if(document.searchForm.countyid) document.searchForm.countyid.selectedIndex    = 0;
		        if(document.searchForm.packagevalue) document.searchForm.packagevalue.value        = "";
		        if(document.searchForm.packagevalue) document.searchForm.packagevalue.blur();
		        if(document.getElementById('vm_full')) document.searchForm.vm_full.checked     = false;
		        if(document.getElementById('vm_pref')) document.searchForm.vm_pref.checked     = false;
		        if(document.getElementById('vm_cons')) document.searchForm.vm_cons.checked     = false;
		        if(document.getElementById('vm_all')) document.searchForm.vm_all.checked     = true;
		    }
		}
	
		 function resetTopSearch() {
	            var name = document.searchForm.company_name;
	            if (name.value != "TYPE COMPANY NAME") {
	                name.value = "TYPE COMPANY NAME";
	            }
	        } 
		 currentSearch   = ""; // Used to hold the current search string for
         // incremental searching
currentSelected = ""; // The last found text. Used for checking we are
						// searching
         // with the same select.
function doIncrementalSelect(comboBox) {
				if(document.all) {
					nbr = event.keyCode;
					searchIndex = -1;
					// Check to make sure the select hasn't changed
					if (comboBox.selectedIndex == -1 || 
						currentSelected != comboBox.options[comboBox.selectedIndex]) {
						currentSearch   = "";
					}
					// Add the new key to the search
					currentSearch += String.fromCharCode(nbr);
					switch(nbr) {
						case 13: // CR
							break;
						case  8: // Backspace
							// Remove the backspace and the last character from
							// the search
							currentSearch = currentSearch.slice(0, currentSearch.length - 2);
						default: 
							searchIndex = searchOptions(comboBox.options, currentSearch);
							// Re-start the search on no-match with the last
							// character entered
							if (searchIndex == -1) {
								currentSearch = String.fromCharCode(nbr);
								searchIndex = searchOptions(comboBox.options, currentSearch);
							}     
							// If it's still not found then go to the first
							// option
							if (searchIndex == -1) {
								currentSearch = " ";
								searchIndex   = 0;
							}
							// Set the option and store for later comparison
							comboBox.selectedIndex = searchIndex;
							currentSelected        = comboBox.options[comboBox.selectedIndex];
							// Remove the keystroke from the event queue
							event.returnValue = 0;
					}
				}
			}
/*****for update mynewdetails page****/

function statechange1(){
	
	var form5=document.mycontactform;
	var dd=form5.countryname.selectedIndex;
	var ss=form5.countryname[dd].text;	

	if(ss=="Great Britain"){
		form5.statename.disabled=false;
		form5.townname.disabled=false;
		form5.Address4.disabled=true;
	    form5.Address5.disabled=true;
	    document.getElementById("Address5").className="dontdisplay"; 
		document.getElementById("Address4").className="dontdisplay"; 
	}else{
	    form5.Address4.disabled=false;
	    form5.Address5.disabled=false;
	    form5.statename.disabled=true;
		form5.townname.disabled=true;
		document.getElementById("Address5").className="tabdisplay"; 
		document.getElementById("Address4").className="tabdisplay"; 
		
		
	}
	
}
function settext1(){
	
	var form5=document.addnewVendor;
	
	var dd=form5.statename.selectedIndex;
	var ss=form5.statename[dd].text;	
	if(ss=="Other" ){
		form5.Address5.disabled=false;
        form5.Address5.focus();
	}else{
		form5.Address5.disabled=true;
	}

}
function settext(){
	
	var form5=document.addnewVendor;
	
	var dd=form5.townname.selectedIndex;
	var ss=form5.townname[dd].text;	
	if(ss=="Other" ){
		form5.Address4.disabled=false;
        form5.Address4.focus();
	}else{
		form5.Address4.disabled=true;
	}

}


function formvalidations(prcodes)
{
	
	var form2=document.addnewVendor;
	var countryindex=form2.countryname.selectedIndex;
	var countyindex=form2.statename.selectedIndex;
	var townindex=form2.townname.selectedIndex;
	var country=form2.countryname[countryindex].text;		
	var county=form2.statename[countyindex].text;		
	var town=form2.townname[townindex].text;
	
	if(form2.coname.value =='' ){
		
		alert("Please enter a company name");
		form2.coname.focus();
		return;
		
	}
	if(form2.coname.value.length <3 ){
		
		alert("Company Name should be atleast 3 charector long!!!");
		form2.coname.focus();
		return;
		
	}
	
if(form2.Address1.value==''){
		alert("Please enter Address1");
		form2.Address1.focus();
		return;
	}
	if(form2.Address2.value==''){
		alert("Please enter Address2");
		form2.Address2.focus();
		return;
	}
	if(form2.Address3.value==''){
		alert("Please enter Address3");
		form2.Address3.focus();
		return;
	}
	if(country=="Great Britain" && countyindex=="0" && townindex=="0"){   	
	   	alert("Please select either a town name or County name or both");
	   	form2.townname.focus();
	   	return;
	   }
	   
	    if(country !="Great Britain" && form2.Address4.value=="" && form2.Address5.value==""){   	
	   	alert("Please enter either a town name or County name or both");
	   	form2.Address4.focus();
	   	return;
	   }
		if(country =="Great Britain" && form2.postcode.value =='' ){
			
			alert("Please enter a PostCode");
			form2.postcode.focus();
			return;
			
		}

	
    var myTelNo = form2.phoneno.value;
  
   if (myTelNo =="" ) {
     alert ("Please enter a Main telephone number");
     form2.phoneno.focus();
     return;
  }
	 if ( myTelNo.length<=6) {
     alert ("Please enter Main telephone number greater than 6 charectors");
      form2.phoneno.focus();
     return;
  }
	if(form2.Email.value==''){
		
	alert("Please enter the EmailID");
		form2.Email.focus();
		return;
	}
	
	var emailID=form2.Email;
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return;
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return;
	}
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		  return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		   return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		   return false;
		 }
          return true;
 					
	}
	
	if(form2.myname.value==''){
		
	alert("Please enter your Name");
		form2.myname.focus();
		return;
	}
	phnnumbr=form2.myphnenmber.value;
	if (phnnumbr=="") {
     alert ("Please enter a your phone number");
     form2.myphnenmber.focus();
     return;
  }  
	if (phnnumbr.length<=6) {
     alert ("Please enter a phone number greater than 6 charectors");
     form2.myphnenmber.focus();
     return;
  }
	form2.method="POST";
	form2.action="addmyvendor.php";
	form2.submit();
	
}
/****mydetailspage***/

function settext2(){
	
	var form5=document.mycontactform;
	
	var dd=form5.statename.selectedIndex;
	var ss=form5.statename[dd].text;	
	if(ss=="Other" ){
		form5.Address5.disabled=false;
        form5.Address5.focus();
	}else{
		form5.Address5.disabled=true;
	}

}
function settext3(){
	
	var form5=document.mycontactform;
	
	var dd=form5.townname.selectedIndex;
	var ss=form5.townname[dd].text;	
	if(ss=="Other" ){
		form5.Address4.disabled=false;
        form5.Address4.focus();
	}else{
		form5.Address4.disabled=true;
	}

}




/***end of mynewdetails*****/
function VisitWeb(urn)
{
	var nForm = document.frmsearch;
	nForm.setAttribute("target", "_blank"); 
	nForm.URN.value=urn;
	nForm.type.value=4;
	nForm.URL.value="Y";
	nForm.action="view_vendor.php"; 
	nForm.submit(); 
				        
			
//	window.open("view_vendor.php",'_blank');
//	nForm.submit();
//var myVar= "view_vendor.php?URN="+urn+"&URL=Y&type=4";

}

function ViewVendor(URN,isHome)
{
	
	var nForm = document.frmsearch;
	nForm.URN.value=URN;
	nForm.type.value=8;
	nForm.action ="newvendorcontactdetails.php";
	nForm.submit();
}
			function searchOptions(options, searchText) {
			    searchArray = -1;
			    searchText  = searchText.toUpperCase();
			    
			    // Search for a matching option
			    for (i = 0; i <= options.length - 1; i++) {
			        if (options[i].text.toUpperCase().indexOf(searchText) == 0) {
			            searchIndex = i;
			            break;
			        }
			    }
			    
			    return searchIndex;
			}


			    
			// End of incremental select code

			    /**
				 * trimWhitespace(str) - use this on form values before they are
				 * checked for zero-length string on form validation to prevent
				 * users from entering blank spaces.
				 */
			    
			    function trimWhitespace(str) {
			        return str.replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1');
			    }

			    // This is here 'cos I don't know why Jamie named it
				// trimWhitespace?!!
			    function trim(str) {
			        return trimWhitespace(str);
			    }

	    
			    
/*
			     * jQuery Easing v1.1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php
			     *
			     * Uses the built in easing capabilities added in jQuery 1.1
			     * to offer multiple easing options
			     *
			     * Copyright (c) 2007 George Smith
			     * Licensed under the MIT License:
			     *   http://www.opensource.org/licenses/mit-license.php
*/

			   jQuery.extend({easing:{easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var ts=t-d/2;return-2*c*ts*ts/(d*d)+2*c*ts/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}return flip*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1}if(t<d/2)return flip*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return flip*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},linear:function(x,t,b,c,d){return c*t/d+b}}});
			   
			   
/****jquery.easing.1.1.1.js end ****/
			    
			// ColorBox v1.3.17.2 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
			// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
			// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
			(function(a,b,c){function bc(b){if(!U){P=b,_(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=Z(K.initialWidth,"x"),K.h=Z(K.initialHeight,"y"),X.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),ba(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}X.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(X.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(X.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(P),a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.substring(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div"),c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bc(f[0]);return f},X.init=function(){z=a(c),r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y("Overlay",o?"position:absolute":"").hide(),s=Y("Wrapper"),t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"),E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close")),s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),B=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){X.next()}),H.click(function(){X.prev()}),I.click(function(){X.close()}),J=G.add(H).add(E).add(F),t.children().removeClass("hover"),q.click(function(){K.overlayClose&&X.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),X.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})},X.remove=function(){r.add(q).remove(),a("."+g).removeData(e).removeClass(g)},X.position=function(a,c){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var d=0,e=0;z.unbind("resize."+f),r.hide(),K.fixed&&!o?r.css({position:"fixed"}):(d=z.scrollTop(),e=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0):K.left!==!1?e+=Z(K.left,"x"):e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0):K.top!==!1?d+=Z(K.top,"y"):d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2),r.show(),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:d,left:e},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",c&&c(),setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})},X.resize=function(a){if(S){a=a||{},a.width&&(K.w=Z(a.width,"x")-O-M),a.innerWidth&&(K.w=Z(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=Z(a.height,"y")-N-L),a.innerHeight&&(K.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height(),b.replaceWith(b.children())}A.css({height:K.h}),X.position(K.transition==="none"?0:K.speed)}},X.prep=function(b){function h(){K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!!S){var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y("LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function o(){n&&r[0].style.removeAttribute("filter")}var b,c,g,h,i=y.length,k,l;!S||(l=function(){clearTimeout(W),C.hide(),ba(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show(),i>1?(typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show(),G[K.loop||Q<i-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),b=Q?y[Q-1]:y[i-1],g=Q<i-1?y[Q+1]:y[0],K.slideshow&&F.show(),K.preloading&&(h=a.data(g,e).href||g.href,c=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,c=a.isFunction(c)?c.call(b):c,$(h)&&(a("<img/>")[0].src=h),$(c)&&(a("<img/>")[0].src=c))):J.hide(),K.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],K.fastIframe?l():a(k).one("load",l),k.name=f+ +(new Date),k.src=K.href,K.scrolling||(k.scrolling="no"),n&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(A).one(m,function(){k.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,o):o())},K.transition==="fade"?r.fadeTo(d,0,function(){X.position(0,c)}):X.position(d,c)}},X.load=function(b){var c,d,e=X.prep;T=!0,R=!1,P=y[Q],b||_(),ba(m),ba(i,K.onLoad),K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y"),K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=Z(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=Z(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,W=setTimeout(function(){C.show()},100),K.inline?(Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):$(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){X.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},X.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Q<y.length-1?Q+1:0,X.load())},X.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Q?Q-1:y.length-1,X.load())},X.close=function(){S&&!U&&(U=!0,S=!1,ba(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),ba(m),A.remove(),setTimeout(function(){U=!1,ba(l,K.onClosed)},1)}))},X.element=function(){return a(P)},X.settings=d,V=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+g,"click",V):a("."+g).live("click",V),a(X.init)})(jQuery,document,this);	    
/* 
 * 				SWFObject v2.1 <http://code.google.com/p/swfobject/>
				Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
				This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
		var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();		 
