function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function chk_clf_business(frmname,type)

{

	var msg = "", dc = eval("document." + frmname);
	
	if(dc.where.value != "admin"){//no validation needed for admin 031108

	if(dc.where.value == "admin" && dc.member_id.value <= 0)
		msg += "Please select a user!\n";
	

	if(dc.ct_email.value.length == 0)
		msg += "Please enter email!\n";

	else if(!chk_email(dc.ct_email))
		msg += "Please enter a valid email address!\n";

	
	if(dc.title.value.length == 0)
		msg += "Please enter a title!\n";		
	
	
	if(dc.primary_cat1.value <=0)
			msg+="Please choose Primary Category!\n";
	
					
	if(dc.primary_cat2.value > 0 ||  dc.primary_cat3.value > 0)
	{
	
		if((dc.primary_cat1.value == dc.primary_cat2.value) || (dc.primary_cat1.value == dc.primary_cat3.value) || (dc.primary_cat3.value == dc.primary_cat2.value))
			msg += "Please select distinct Business categories. You have selected a \nparticular Business category more than once for your Classifieds\n"
	
	}
	
	if(document.getElementById('country'))
	{		
		if(dc.country.value.length == 0)
			msg += "Please choose country!\n";
	}		
			
	/*if(dc.phone.value.length == 0)
		msg += "Please enter phone number!\n";310308*/
	//030508
	if(dc.image1_thumb.value.length > 0 || dc.thumb_image1.value.length > 0)
	{
	
		if(dc.image1_title.value.length==0)
			msg+="Please enter Main Image Title!\n";		
			
	}
	
	if(dc.image2_thumb.value.length > 0 || dc.thumb_image2.value.length > 0)
	{
	
		if(dc.image2_title.value.length==0)
			msg+="Please enter Image 2 Title!\n";		
			
	}
	
	if(dc.image3_thumb.value.length > 0 || dc.thumb_image3.value.length > 0)
	{
	
		if(dc.image3_title.value.length==0)
			msg+="Please enter Image 3 Title!\n";		
			
	}
	//030508
	
	var isexist=false;
						
	for(i=0;i<dc.elements.length;i++)
	{	
		
		
		var_name=dc.elements[i].name;
		
			
		if(var_name!="web_url" && var_name!="return_url" && var_name!="ct_email" && var_name!="link_url" && var_name!="link_text" && var_name!="link_desc" && var_name!="link_code")
		{	
			
			
				count1=new Array();
				count2=new Array();
				count3=new Array();

				count1=dc.elements[i].value.split("www");
				count2=dc.elements[i].value.split("@");
				count3=dc.elements[i].value.split("http");
		
	   }
		 	
	  if(count1.length >1)
	  {
			isexist=true;		
			break;
	  }	
		
	  if(count2.length >1)
	  {
			isexist=true;		
			break;
	  }				
		
	  if(count3.length >1)
	  {
			isexist=true;		
			break;
	  }	
		
  }
			
				
				
  if(isexist)		
	msg+="www, @, http are not allowed\n";
			
  if(msg.length > 0)
  {
		alert(msg);
		return false;
  }
  
  if(dc.web_url.value == "http://")
	dc.web_url.value = "";

  if(dc.return_url.value == "http://")
	dc.return_url.value = "";
	
if(document.getElementById('states_dd') || document.getElementById('state'))
{		
  if(dc.states_dd.getAttribute("className") == "showObject") 
	setstate(dc.states_dd);
}

	}//no validation needed for admin 031108

	if(type!="admin")
	{
		if(document.getElementById('states_dd') || document.getElementById('state'))
		{		
			if(dc.states_dd.value.length == 0)
			{			
				if(!confirm("You've not selected a state - continue anyway?"))
				{				
					dc.chk_locations.value="1";
					alert("Please choose state!\n");
					return false;
				}
				else
					dc.chk_locations.value="0";
			}
		}
		
		if(dc.chk_locations.value==1)
		{
			var ms="";
			
			if(dc.zip.value.length == 0)
				ms+= "Please enter Zip!\n";				
				
			if(dc.city.value<=0 && dc.unapproved_city.value<=0)//291008
				ms += "Please choose a city!\n";
						
			if(ms.length > 0)
			{
				alert(ms);
				return false;
			}								
		}			
  }

  return true;
  
 } 
 
 function chk_clf_prod(frmname, business_id, type)
 {
 
 	var msg = "", dc = eval("document." + frmname);
	
	if(dc.where.value == "admin" && dc.member_id.value <= 0)
		msg += "Please select a user!\n";

	if(business_id <= 0)
	{		
	
		if(dc.fname.value.length==0)
			msg+="Please enter First Name!\n";
		
		if(dc.lname.value.length==0)
			msg+="Please enter Last Name!\n";	
		
		if(dc.ct_email.value.length == 0)
			msg += "Please enter email!\n";

		else if(!chk_email(dc.ct_email))
			msg += "Please enter a valid email address!\n";	
	
	if(type!="admin")//270808
	{
		if(document.getElementById('country'))
		{				
			if(dc.country.value.length == 0)
				msg += "Please choose country!\n";
		}		
		
		if(dc.phone.value.length == 0)
			msg += "Please enter Phone Number!\n";
	  }				
		
   }//270808
		
	if(dc.primary_cat1.value <=0)
			msg+="Please choose Primary Category!\n";
	
	
	if(dc.primary_cat2.value > 0 ||  dc.primary_cat3.value > 0)
	{
	//200707
		if((dc.primary_cat1.value == dc.primary_cat2.value && dc.primary_cat1.value > 0) || (dc.primary_cat1.value == dc.primary_cat3.value && dc.primary_cat1.value > 0) || (dc.primary_cat3.value == dc.primary_cat2.value))
			msg += "Please select distinct Product categories. You have selected a \nparticular Product category more than once for your Classifieds\n"
	
	}
	
	if(dc.title.value.length == 0)
		msg += "Please enter a title!\n";
		
	if(dc.price.value.length == 0)
		msg += "Please enter price!\n";
		
	if(business_id > 0)
	{	
		if(dc.business_id.value.length == 0)
			msg += "Please choose a Business Classified!\n";		
	}
	
		
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	
	else
	{
		if(type!="admin")//270808
		{
		
			if(document.getElementById('states_dd') || document.getElementById('state'))
			{	
				if(dc.states_dd.value.length == 0)
				{
					if(!confirm("You've not selected a state - continue anyway?"))
					{				
						dc.chk_locations.value="1";
						alert("Please choose state!\n");
						return false;
					}
					else
						dc.chk_locations.value="0";
					
				}
			}
		
			if(dc.chk_locations.value==1)
			{				
				var ms="";
				
				if(dc.zip.value.length == 0)
					ms += "Please enter Zip!\n";				
					
				if(dc.city.value<=0 && dc.unapproved_city.value<=0)
					ms += "Please choose a city!\n";								
				
				if(ms.length > 0)
				{
					alert(ms);
					return false;
				}								
			}
		
		}
		return true;		
	}
 	
 }
 
 function setstate(obj,frmname,field)//151008
{
	if(frmname!="clf_business_frm")
	{
		if(field=="venue_state")
			set_field(frmname,'venue_state',obj.value);
		else
			set_field(frmname,'state',obj.value);	
	}
	else
	{
		
		set_field('clf_business_frm','state',obj.value);
	}	
}//151008

function chk_review()
{

   var msg="";
   
   var rating_chosen=false;
	
	//060907
	for(i=0;i<document.review_detail_frm.elements.length;i++)
	{
		var_name=document.review_detail_frm.elements[i].name;
		
		if(var_name=="rating")
		{
			if(document.review_detail_frm.elements[i].checked==true)
			{
//
				rating_chosen=true;
				break;
			}	
						
		}
	
	}	
	
	
	  
	  if(document.review_detail_frm.where.value=="admin" && document.review_detail_frm.user_id.value<=0)
	  	msg+="Please choose a Users\n";
	 	 
	  if(document.review_detail_frm.title.value.length==0)
   
	      msg+="Please enter Review Title\n"; 
		  
	  if(document.review_detail_frm.description.value.length==0)
   
	      msg+="Please enter Description\n"; 
		  	  
	if(document.review_detail_frm.allow_links.value==0)
	{ 
	  var isexist=false;
		
		for(i=0;i<document.review_detail_frm.elements.length;i++)
		{	
		
		
		  var_name=document.review_detail_frm.elements[i].name;
		
		  if(var_name!="posted_email")
		  {
				
			count1=new Array();
			count2=new Array();
			count3=new Array();

			count1=document.review_detail_frm.elements[i].value.split("www");
			count2=document.review_detail_frm.elements[i].value.split("@");
			count3=document.review_detail_frm.elements[i].value.split("http");
		   }			
		   if(count1.length >1)
	   	   {
				isexist=true;		
				break;
		   }	
		
 	  	  if(count2.length >1)
		  {
				isexist=true;		
				break;
		  }				
		  
		  if(count3.length >1)
		  {
				isexist=true;		
				break;
		  }	
		
	  }  //end of for
					
					
	 if(isexist)		
		msg+="www, @, http are not allowed\n";
	 
	  
	  	
  } //end of if(document.review_detail_frm.allow_links.value==0)
     
  if(!rating_chosen)
		msg+="Choose your Rating!\n";
	//060907  			
	 if(msg.length > 0)
	 {
	 
	    alert(msg);
		return false;
		
	 }	 
	 else
	 {
	 
	    return true;
		
     }
	 
}	 		

function chk_user()
{

	var msg="";
	
	if(document.user_regfrm.name.value.length==0)
		msg+="Enter Your Name\n";
		
	if(document.user_regfrm.email.value.length==0)
		msg+="Enter Email Address\n";	
	else

	{

		if(!chk_email(document.user_regfrm.email))

		{

			msg+="Please enter a valid Email\n";

		}

	}  	
		
	if(document.user_regfrm.password.value.length==0)
		msg+="Enter Password\n";
		
	if(msg.length > 0)
	{
	
		alert(msg);
		
		return false;
	}
	else
		return true;
		
}		

function chk_report_form(frmname) //user
{

	var msg = "", dc = eval("document." + frmname);		
	
	if(dc.email.value.length == 0)
		msg += "Please enter your email!\n";
	else if(!chk_email(dc.email))
		msg += "Please enter a valid email!\n";
	
	if(dc.message.value.length == 0)
		msg += "Please enter your Report!\n";
	
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
	{
		return true;
	}

}	

function chk_country_zip(frmname)
{

	var msg="",dc;

	dc=eval("document."+frmname);
		
	set_field('postcode_frm','cityval',dc.confirm_city.value);
	set_field('postcode_frm','stateval',dc.states_dd.value);
				
	if(dc.states_dd.value <=0)
		msg+="Please choose a State\n";	

	if(dc.confirm_city.value.length < 2) //180708
			
		msg+="Please enter atleaset 2 characters of your city\n";
		
	if(msg.length >0)
		alert(msg);
	else	
		document.postcode_frm.submit(); 
				
		
}			
	
function confirm_delete(url, obj)







{







str="Do you really want to delete " + obj +"?";















msg= confirm (str);







		if (msg)







		{







			window.location.href = url;







		}







}



/**********************







Function for setting hidden values in the form















*************************/















function set_field(formname,fieldname,set_value)

{
	//	alert(formname + "|" + fieldname + "|" + set_value);

		str="document." + formname + "." + fieldname  + ".value='" + set_value + "'";

		//alert(str);
		eval(str);

}















/******************************************************************/




function edit_link(frm_name,val){







	



		frm_name.linkdeleteid.value = '';



		



		frm_name.id.value = val;



		



		frm_name.editid.value = val;



		



		frm_name.show_list.value = "N";



		



		frm_name.submit();







}

function delete_link(frm_name,val){







	if(confirm("Are you sure you want to delete?")){



	



		frm_name.linkdeleteid.value = val;



		



		frm_name.editid.value = '';







		frm_name.id.value = val;







		frm_name.submit();







	}







}

/************************************************************************/


/****function to change the page in categories (customer/links) upon choosing a category to edit****/







function change_page(obj, actionpage)



{







	if(obj.value > 0)



	{



	



		str="window.location.href='" + actionpage + "?id=" + obj.value + "&hidden_purpose=paging'";



		//alert(str);



		eval(str);



	}



	



}



// used to set the values for category in link

function getvalues(obj) //changed on 170904



{



//get_val=obj.value;

get_val = obj; //170505




//if(obj.value.length > 1)
if(obj.length > 1) //170505



{



//alert(get_val);



a = get_val.split("|");







id = a[0];







link_page=a[2];



link_text=a[3];



link_code=a[4];



link_description=a[5];



catid=change_quotes(id,'primary_cat1');







link_page=change_quotes(link_page,'c_url');



link_text=change_quotes(link_text,'c_link_txt');





link_code=change_quotes(link_code,'c_link_code');

link_description=change_quotes(link_description,'link_description');

}//changed



else



{



link_page=change_quotes('','c_url');



link_text=change_quotes('','c_link_txt');



link_code=change_quotes('','c_link_code');

link_description=change_quotes('','link_description');


}


}
//modified on 20102003//



function change_quotes(abc,field_name)



{







	str = abc;



	



	do{



		count=new Array();



		str = str.replace("!~!","\\'");



		count = str.split("!~!");



	}while(count.length >1);







	do{



		count=new Array();



		str = str.replace("~@#","\"");



		count = str.split("~@#");



		



	}while(count.length >1);



	



	//str = str.replace("~@#","\"");







	chk_quote=str.split("\"");







	//alert("Count "+ chk_quote.length);



	



	if(chk_quote.length >1)



	{



		eval_str="window.opener.document.link_search."+field_name+".value='"+str+"'"; //170505 - window.opener added as the values should be set to the parent window.



	}	



	else



	{



		eval_str="window.opener.document.link_search."+field_name+".value=\""+str+"\"";//170505 - window.opener added as the values should be set to the parent window.



	}







		eval(eval_str);



	



	



}


function goTo(url){ //user



	window.location = url;



}

///--------- newly added 27 - 09 - 2003



function delete_record(frm,fld,val)



{



	if(confirm('Do you really want to delete ?'))



	{



		set_field(frm,fld,val);



		str = "document." + frm + ".submit()";



		eval(str);



	}



}

/**************************EMAIL CHECKING***************************/

 

function chk_email(fldname)

{



 

	var bool=true;

	 

	email = fldname.value;

	var len = email.length;              

	if(len<5)

		{

//			alert("Invalid Email - id")



//            fldname.value="";



			bool=false;

		}

	else

		{

          

	var index1 = email.indexOf('@');

	var subind = email.substring(0,index1);

	var indlen = subind.length;

	var index2 = email.indexOf('.');

	var subind1=email.substring(indlen+1,index2);

	var indlen1 = subind1.length;

	var index3 = email.indexOf(' ');

	var subind3=email.substring(index2+1,len)

	var indlen2 = subind3.length;

	if((index1!= -1)&&(index2!= -1)&&(index3==-1))

	{	

		if((indlen!=0)&&(indlen1!=0)&&(indlen2!=0))

		{

//   			alert("valid Email -id");		  	 	

		} 

        else

		{

		

//			alert("Invalid Email - id")

//            fldname.value="";

		}

	}

	else

	{

//   		alert("Invalid Email - id");

//        fldname.value="";

			bool=false;

	}		

	} // end of else if len<5



	return(bool);



}

function initRefs(){
	/*var spans = document.getElementsByTagName('span');
	for(var i=0; i<spans.length; i++){
		if(spans[i].className == 'pref'){
			spans[i].className = 'ulref';
			spans[i].onclick = function(e){
				if(this.className=='ulref'){
					this.className = 'ulrefopen';
				}else{
					this.className = 'ulref';
				}
			}
		}
		if(spans[i].className =='BlueLink3'){
			//var url = unescape(spans[i].getAttribute('title'));
			spans[i].onclick = function(e){
				var url = unescape(this.getAttribute('title'));
				window.location = url;
			}
		}
	}*/
	var spans = document.getElementsByTagName('span');
	for(var i=0; i<spans.length; i++){
		if(spans[i].className == 'word'){
			spans[i].onclick = function(e){
				if(this.className=='word-open'){
					this.className = 'word';
				}else{
					this.className = 'word-open';
				}
			}
		}else if(spans[i].className == 'word-related'){
			spans[i].onclick = function(e){
				var url = links[this.getAttribute('title')];
				if(url){
				window.location = url;
				}		
			}
		}
	}
	
}
function addEvent( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener( type, fn, false );
		EventCache.add(obj, type, fn);
	}
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
		EventCache.add(obj, type, fn);
	}
	else {
		obj["on"+type] = obj["e"+type+fn];
	}
}

var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){
					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();

//clf_business_details

function select_main_image(file){
	var current_image;
	if(file == current_image){
		return;
	}
	current_image = file;
	if(document.getElementById('main_product_image')){
		document.getElementById('main_product_image').src = file;
	}
}
function init(){

	var tds = document.getElementsByTagName('td');
	for(var i=0; i<tds.length; i++){
		if(tds[i].className.indexOf('additional_image_cell')){
			// now grab the para tag and look at its keywords...
			var ps = tds[i].getElementsByTagName('p');
			if(ps && ps.length ==1){
				var p = ps[0];
				var words = p.innerHTML.split(' ');
				if(document.referrer){
					for(var k=0; k<words.length; k++){
						if(document.referrer.indexOf(words[k]) > 0){
							select_main_image(p.className,p.innerHTML);
							return;
						}
					}
				}
			}
		}
	}
}
function highlight_image(id){
	var img = document.getElementById(id);
	img.className = 'highlight_border';
	//setTimeout("remove_highlight('"+id+"')",3000);
}
function remove_highlight(id){
	var img = document.getElementById(id);
	img.className = 'normal_border';
}

//clf_business_detail.php
function MM_popupMsg(msg) { //v1.0
  alert(msg);
 }
 
 //link_details.php
function get_remote()
{
	
	url = document.link_search.url.value;
		
	
	url ="get_remote.php?url="+url;
	window.open(url);	
}

function set_status_them(obj)
{
	if(obj.value==0)
	{
		set_field("link_search", "link_status", "Pending Approval");
	}
	else
	{
		set_field("link_search", "link_status", "Active");
	}
}

function add_link(userid)
{
	var msg="";
	
	if(document.link_search.user_id.value.length==0)
	{
		msg+="Please choose a member\n";					
	}

	if(document.link_search.url.value.length==0 || document.link_search.url.value=="http://")
		msg+="Please enter URL\n";
	if(document.link_search.primary_cat1.value == 0) //170505 - drop down removed and category is chosen from a popup
		msg+="Please Choose Primary Category\n";
//-------------
if(userid <= 0 && edit_param <= 0) //impiies admin area..
{

if(edit_param <= 0)
{
if(document.link_search.email.value.length==0)
		msg+="Please enter Email\n";
	else
	{
		if(!chk_email(document.link_search.email))
		{
			msg+="Please enter a valid Email\n";
		}
	}		
}//new

//------------
}// implies admin area
//060406 - same category should not be assigned to a link more than once this should be validated - as per newer link system. - Start
	//primary category will be always chosen, only category 2 and 3 are optional, if they are selected check that they were not the same
	if(document.link_search.primary_cat2.value > 0 ||  document.link_search.primary_cat3.value > 0)
	{
	//200707
		if((document.link_search.primary_cat1.value == document.link_search.primary_cat2.value && document.link_search.primary_cat1.value > 0) || (document.link_search.primary_cat1.value == document.link_search.primary_cat3.value && document.link_search.primary_cat1.value > 0) || (document.link_search.primary_cat3.value == document.link_search.primary_cat2.value))
			msg += "Please select distinct link categories. You have selected a \nparticular link category more than once for your link\n"
	
	}
//060406 - same category should not be assigned to a link more than once this should be validated - as per newer link system. - End
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}	
	else
	{
//chk whether url / reciprocal url starts with http://
		if(document.link_search.url.value.substr(0,7)!="http://")
		{
			document.link_search.url.value="http://" + document.link_search.url.value;
		}
		
		if(document.link_search.reciprocal_url.value.length > 0 && document.link_search.reciprocal_url.value.substr(0,7)!="http://")
		{
			document.link_search.reciprocal_url.value="http://" + document.link_search.reciprocal_url.value;
		}
		<!-- //080305 - http://should not be saved in db as per the document on 080305 -->
		else if(document.link_search.reciprocal_url.value == "http://")
		{
			
			document.link_search.reciprocal_url.value="";
			//document.link_search.status_link_to_us.value="N/A"; - 060505
		}
		
		
		/* 110909 not needed.. allow for final / too...
		
//remove final "/" trailing slash.. for eg., http://www.sitename.com.au/ should be saved in db as http://www.sitename.com.au
		reciurl=document.link_search.url.value;
		if(reciurl.charAt(reciurl.length - 1)=="/")		
		{
			document.link_search.url.value=reciurl.substring(0, reciurl.length-1);
		}
		
		*/
		return true;
	}
		
}

function reciprocal(obj)
{	
	if(obj.value.length > 0)
		document.link_search.status_link_to_us.value = "Not Checked";

}
//link_details.php - end

//link_cat_list,link_cat_selection
function addlinkcat(hid_fld,hid_val,cat_name,selected_cat_str)
{
cat_name = cat_name.replace("!~!","\'"); //250609
switch (hid_fld)
{

	case "primary_cat1":
		window.opener.document.link_search.primary_cat1.value = hid_val;
		window.opener.document.getElementById('cat1').innerHTML = cat_name;
		window.opener.document.getElementById('cat1td1').width = '50%';
		window.opener.document.getElementById('cat1td2').width = '50%';
		getvalues(selected_cat_str);
		break;

	case "primary_cat2":
		window.opener.document.link_search.primary_cat2.value = hid_val;
		window.opener.document.getElementById('cat2').innerHTML = cat_name;
		window.opener.document.getElementById('cat2td1').width = '50%';
		window.opener.document.getElementById('cat2td2').width = '50%';
		break;

	case "primary_cat3":
		window.opener.document.link_search.primary_cat3.value = hid_val;
		window.opener.document.getElementById('cat3').innerHTML = cat_name;
		window.opener.document.getElementById('cat3td1').width = '50%';
		window.opener.document.getElementById('cat3td2').width = '50%';
		break;

} //end switch
window.opener.focus();
window.close();

}

//inappropriate_review_report.php
function chk_report_form(frmname)
{

	var msg = "", dc = eval("document." + frmname);		
	
	if(dc.email.value.length == 0)
		msg += "Please enter your email!\n";
	else if(!chk_email(dc.email))
		msg += "Please enter a valid email!\n";
	
	if(dc.message.value.length == 0)
		msg += "Please enter your Report!\n";
	
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
	{
		return true;
	}

}

//ad_email_form.php

function chk_msg_form(frmname)
{

var msg = "", dc = eval("document." + frmname);

if(dc.name.value.length == 0)
	msg += "Please enter Your Name!\n";
	
if(dc.email.value.length == 0)
	msg += "Please enter Your Email!\n";
else if(!chk_email(dc.email))
	msg += "Please enter a valid email!\n";
	
if(dc.message.value.length == 0)
	msg += "Please enter your queries!\n";
	
if(msg.length > 0)
{
	alert(msg);
	return false;
}
else
{
	return true;
}

}

//classified_city_selection.php
function addclassifiedcity(hid_val,city_name, frmname, fieldname)
{
	if(frmname.length > 0)
		frm=frmname;
	else
		frm="clf_business_frm";
		
	var winopener;
			
	winopener=eval("window.opener.document."+frm+"."+fieldname);
		if(fieldname=="unapproved_city")
			eval("window.opener.document."+frm+".city.value=''");
		winopener.value = hid_val;
		window.opener.document.getElementById('zip1').innerHTML = city_name;
	    		
		window.opener.focus();
		
		window.close();
}

//clf_business_detail.php
function classifiedlinkcode()
{
	val = "<a href=\"" + document.clf_business_frm.link_url.value + "\">" + document.clf_business_frm.link_text.value + "</a>" + " " + document.clf_business_frm.link_desc.value;
	document.clf_business_frm.link_code.value = val;
}

//cat_selection
function addbusinesscat(hid_fld,hid_val,cat_name,selected_cat_str)
{
//240307 for showing category name by replacing "!~!"
	cat_name = cat_name.replace("!~!","\'");
	
switch (hid_fld)
{
	case "primary_cat1":
		window.opener.document.clf_business_frm.primary_cat1.value = hid_val;
		window.opener.document.getElementById('cat1').innerHTML = cat_name;
		window.opener.document.getElementById('cat1td1').width = '50%';
		window.opener.document.getElementById('cat1td2').width = '50%';
		getbusinesscatvalues(selected_cat_str);
		break;
		
		case "primary_cat2":
		window.opener.document.clf_business_frm.primary_cat2.value = hid_val;
		window.opener.document.getElementById('cat2').innerHTML = cat_name;
		window.opener.document.getElementById('cat2td1').width = '50%';
		window.opener.document.getElementById('cat2td2').width = '50%';
		
		break;
		
		case "primary_cat3":
		window.opener.document.clf_business_frm.primary_cat3.value = hid_val;
		window.opener.document.getElementById('cat3').innerHTML = cat_name;
		window.opener.document.getElementById('cat3td1').width = '50%';
		window.opener.document.getElementById('cat3td2').width = '50%';
		
		break;
} //end switch
window.opener.focus();
window.close();
}

function addprodcat(hid_fld,hid_val,cat_name,selected_cat_str)
{
//240307 for showing category name by replacing "!~!"
	cat_name = cat_name.replace("!~!","\'");
	
switch (hid_fld)
{
	case "primary_cat1":
		window.opener.document.clf_prod_frm.primary_cat1.value = hid_val;
		window.opener.document.getElementById('cat1').innerHTML = cat_name;
		window.opener.document.getElementById('cat1td1').width = '50%';
		window.opener.document.getElementById('cat1td2').width = '50%';
		//getvalues(selected_cat_str); - not required for classified category..
		break;
		
		case "primary_cat2":
		window.opener.document.clf_prod_frm.primary_cat2.value = hid_val;
		window.opener.document.getElementById('cat2').innerHTML = cat_name;
		window.opener.document.getElementById('cat2td1').width = '50%';
		window.opener.document.getElementById('cat2td2').width = '50%';
		
		break;
		
		case "primary_cat3":
		window.opener.document.clf_prod_frm.primary_cat3.value = hid_val;
		window.opener.document.getElementById('cat3').innerHTML = cat_name;
		window.opener.document.getElementById('cat3td1').width = '50%';
		window.opener.document.getElementById('cat3td2').width = '50%';
		
		break;
} //end switch
window.opener.focus();
window.close();
}

//user_details.php

function user_login()
{
	
	var msg="";
	if(document.link_search.name.value.length==0)
		msg+="Please enter Name\n";
	if(document.link_search.email.value.length==0)
		msg+="Please enter Email\n";
	else
	{
		if(!chk_email(document.link_search.email))
		{
			msg+="Please enter a valid Email\n";
		}
	}		
	if(document.link_search.password.value.length==0)
		msg+="Please enter Password\n";
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}	
	else
	{
		return true;
	}
}

//links_login.php
//071008
function links_login(owner)

{

	var msg="";

	

	if(document.frmlogin.name.value.length==0)

		msg+="Please enter Name\n";



	if(document.frmlogin.email.value.length==0)

		msg+="Please enter Email\n";

	else

	{

		if(!chk_email(document.frmlogin.email))

		{

			msg+="Please enter a valid Email\n";

		}

	}			



	if(document.frmlogin.password.value.length==0)

		msg+="Please enter Password\n";

	if(owner)
	{
		if(document.frmlogin.phone.value.length==0)

			msg+="Please enter Phone\n";
		
		if(!document.frmlogin.agree.checked)
			
			msg+="Please check the box!\n";
			
	}	//071008

	if(msg.length > 0)

	{

		alert(msg);

		return false;

	}	

	else

	{

		return true;

	}

		



}


//040907 - for health

function show_more_less(moretext, lesstext, what, obj)
{


	if(what=="less")
		whattoshow = lesstext;
	else
		whattoshow = moretext;	

	obj.innerHTML=whattoshow;	
	
}
	 
  //v1.0

function display (category) {
	var whichcategory = document.getElementById(category);
	if (whichcategory.className=="show") {
		whichcategory.className="hide";
	} else {
		whichcategory.className="show";
	}
}

//090208
function getbusinesscatvalues(obj) 



{

get_val = obj; 




if(obj.length > 1) 



{





a = get_val.split("|");


id = a[0];

link_page=a[1];

link_title=a[2];

link_desc=a[3];

catid=change_businesscat_quotes(id,'primary_cat1');

link_page=change_businesscat_quotes(link_page,'link_url');

link_title=change_businesscat_quotes(link_title,'link_text');

link_desc=change_businesscat_quotes(link_desc,'link_desc');

val = "<a href=\"" + window.opener.document.clf_business_frm.link_url.value + "\">" + window.opener.document.clf_business_frm.link_text.value + "</a>" + " " + window.opener.document.clf_business_frm.link_desc.value;
	window.opener.document.clf_business_frm.link_code.value = val;
	
}


else



{


link_page=change_businesscat_quotes('','link_url');

link_title=change_businesscat_quotes('','link_text');

link_desc=change_businesscat_quotes('','link_desc');


}


}

function change_businesscat_quotes(abc,field_name)

{


	str = abc;


	do{

		count=new Array();

		str = str.replace("!~!","\\'");

		count = str.split("!~!");

	}while(count.length >1);


	do{

		count=new Array();

		str = str.replace("~@#","\"");

		count = str.split("~@#");

	}while(count.length >1);

	chk_quote=str.split("\"");

	if(chk_quote.length >1)

	{

		eval_str="window.opener.document.clf_business_frm."+field_name+".value='"+str+"'"; 

	}	

	else

	{


		eval_str="window.opener.document.clf_business_frm."+field_name+".value=\""+str+"\"";


	}

		eval(eval_str);

}

//170308
function set_pname(obj1, obj2){

//alert("1.3");

obj2.value = obj1.value;


clean_chars(obj2);


}

function chk_user_article()
{

	var msg="", dc;
	
	dc=eval("document.frm_article");
	
	if(dc.parent_id.value.length==0)
		msg+="Please choose a category!\n";
	
	if(dc.title.value.length==0)
		msg+="Please enter Article Title!\n";
				
	/*if(dc.business_id.value.length==0)
		msg+="Please choose a Business Classified!\n";*/
	var isexist=false;
						
	for(i=0;i<dc.elements.length;i++)
	{	
				
		count1=new Array();
		count2=new Array();
		count3=new Array();

		count1=dc.elements[i].value.split("href");
		count1=dc.elements[i].value.split("www");		
		count3=dc.elements[i].value.split("http");

			 	
	  if(count1.length >1)
	  {
			isexist=true;		
			break;
	  }	
		
	  if(count2.length >1)
	  {
			isexist=true;		
			break;
	  }				
		
	  if(count3.length >1)
	  {
			isexist=true;		
			break;
	  }	
		
	}
			
	if(isexist)		
		msg+="Please don't add links, we are linking directly to your listing\n";
		
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;			
}

//190308
function clean_chars(obj) {


// will remove any non alphanumeric char from string except for space which it will replace with undesrcor, and set the obj value to the fixed string

	var string = obj.value

		for (var i=0, output='', valid="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; i<string.length; i++)


			if (string.charAt(i)==" "){


				output += "-";


			} else {		


				if (valid.indexOf(string.charAt(i)) != -1){     


					 output += string.charAt(i);


				}

			}    


//130506
	
	for(i = 0; i < output.length; i++)
	{
		if(output.charAt(i - 1) == "-" && output.charAt(i) == "-")
		{
			output = output.replace("--","-");
			i = i - 1;
		}
	}
	
	var op_arr = output.split("-");
	
	//last value should not be a number..

	if(!isNaN(op_arr[op_arr.length - 1]))
		output = output.substring(0, output.lastIndexOf("-"));
	
	
	obj.value = output.toLowerCase();


} 

//190408
function popupwindow(obj)
{
	window.open(obj, '', "scrollbars=yes, menu=no, status=no, resizable=yes, width=640, height=480");
}

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

/*210408*/
function chk_mail_friend(frmname)
{

   var msg="", dc;
   
   dc=eval("document."+frmname);
   //280808
   if(dc.from_name.value.length == 0)
	   msg += "Please enter your Name!\n";
	   
   if(dc.to_name.value.length == 0)
	   msg += "Please enter Friend Name!\n"; //280808
	   	   
   if(dc.from_email.value.length == 0)
	   msg += "Please enter your Email!\n";
	
   else if(!chk_email(dc.from_email))
	   msg += "Please enter a valid email address!\n";
	   
   if(dc.to_email.value.length == 0)
	   msg += "Please enter your Friend Email!\n";
	
   else if(!chk_email(dc.to_email))
	   msg += "Please enter a valid email address!\n";
	   	   
	
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
	
}	

//280408
//start of AJS.js

AJS={BASE_URL:"",drag_obj:null,drag_elm:null,_drop_zones:[],_cur_pos:null,getScrollTop:function(){
var t;
if(document.documentElement&&document.documentElement.scrollTop){
t=document.documentElement.scrollTop;
}else{
if(document.body){
t=document.body.scrollTop;
}
}
return t;
},addClass:function(){
var _2=AJS.forceArray(arguments);
var _3=_2.pop();
var _4=function(o){
if(!new RegExp("(^|\\s)"+_3+"(\\s|$)").test(o.className)){
o.className+=(o.className?" ":"")+_3;
}
};
AJS.map(_2,function(_6){
_4(_6);
});
},setStyle:function(){
var _7=AJS.forceArray(arguments);
var _8=_7.pop();
var _9=_7.pop();
AJS.map(_7,function(_a){
_a.style[_9]=AJS.getCssDim(_8);
});
},extend:function(_b){
var _c=new this("no_init");
for(k in _b){
var _d=_c[k];
var _e=_b[k];
if(_d&&_d!=_e&&typeof _e=="function"){
_e=this._parentize(_e,_d);
}
_c[k]=_e;
}
return new AJS.Class(_c);
},log:function(o){
if(window.console){
console.log(o);
}else{
var div=AJS.$("ajs_logger");
if(!div){
div=AJS.DIV({id:"ajs_logger","style":"color: green; position: absolute; left: 0"});
div.style.top=AJS.getScrollTop()+"px";
AJS.ACN(AJS.getBody(),div);
}
AJS.setHTML(div,""+o);
}
},setHeight:function(){
var _11=AJS.forceArray(arguments);
_11.splice(_11.length-1,0,"height");
AJS.setStyle.apply(null,_11);
},_getRealScope:function(fn,_13){
_13=AJS.$A(_13);
var _14=fn._cscope||window;
return function(){
var _15=AJS.$FA(arguments).concat(_13);
return fn.apply(_14,_15);
};
},documentInsert:function(elm){
if(typeof (elm)=="string"){
elm=AJS.HTML2DOM(elm);
}
document.write("<span id=\"dummy_holder\"></span>");
AJS.swapDOM(AJS.$("dummy_holder"),elm);
},getWindowSize:function(doc){
doc=doc||document;
var _18,_19;
if(self.innerHeight){
_18=self.innerWidth;
_19=self.innerHeight;
}else{
if(doc.documentElement&&doc.documentElement.clientHeight){
_18=doc.documentElement.clientWidth;
_19=doc.documentElement.clientHeight;
}else{
if(doc.body){
_18=doc.body.clientWidth;
_19=doc.body.clientHeight;
}
}
}
return {"w":_18,"h":_19};
},flattenList:function(_1a){
var r=[];
var _1c=function(r,l){
AJS.map(l,function(o){
if(o==null){
}else{
if(AJS.isArray(o)){
_1c(r,o);
}else{
r.push(o);
}
}
});
};
_1c(r,_1a);
return r;
},isFunction:function(obj){
return (typeof obj=="function");
},setEventKey:function(e){
e.key=e.keyCode?e.keyCode:e.charCode;
if(window.event){
e.ctrl=window.event.ctrlKey;
e.shift=window.event.shiftKey;
}else{
e.ctrl=e.ctrlKey;
e.shift=e.shiftKey;
}
switch(e.key){
case 63232:
e.key=38;
break;
case 63233:
e.key=40;
break;
case 63235:
e.key=39;
break;
case 63234:
e.key=37;
break;
}
},removeElement:function(){
var _22=AJS.forceArray(arguments);
AJS.map(_22,function(elm){
AJS.swapDOM(elm,null);
});
},_unloadListeners:function(){
if(AJS.listeners){
AJS.map(AJS.listeners,function(elm,_25,fn){
AJS.REV(elm,_25,fn);
});
}
AJS.listeners=[];
},join:function(_27,_28){
try{
return _28.join(_27);
}
catch(e){
var r=_28[0]||"";
AJS.map(_28,function(elm){
r+=_27+elm;
},1);
return r+"";
}
},getIndex:function(elm,_2c,_2d){
for(var i=0;i<_2c.length;i++){
if(_2d&&_2d(_2c[i])||elm==_2c[i]){
return i;
}
}
return -1;
},isIn:function(elm,_30){
var i=AJS.getIndex(elm,_30);
if(i!=-1){
return true;
}else{
return false;
}
},isArray:function(obj){
return obj instanceof Array;
},setLeft:function(){
var _33=AJS.forceArray(arguments);
_33.splice(_33.length-1,0,"left");
AJS.setStyle.apply(null,_33);
},appendChildNodes:function(elm){
if(arguments.length>=2){
AJS.map(arguments,function(n){
if(AJS.isString(n)){
n=AJS.TN(n);
}
if(AJS.isDefined(n)){
elm.appendChild(n);
}
},1);
}
return elm;
},getElementsByTagAndClassName:function(_36,_37,_38,_39){
var _3a=[];
if(!AJS.isDefined(_38)){
_38=document;
}
if(!AJS.isDefined(_36)){
_36="*";
}
var els=_38.getElementsByTagName(_36);
var _3c=els.length;
var _3d=new RegExp("(^|\\s)"+_37+"(\\s|$)");
for(i=0,j=0;i<_3c;i++){
if(_3d.test(els[i].className)||_37==null){
_3a[j]=els[i];
j++;
}
}
if(_39){
return _3a[0];
}else{
return _3a;
}
},isOpera:function(){
return (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
},isString:function(obj){
return (typeof obj=="string");
},hideElement:function(elm){
var _40=AJS.forceArray(arguments);
AJS.map(_40,function(elm){
elm.style.display="none";
});
},setOpacity:function(elm,p){
elm.style.opacity=p;
elm.style.filter="alpha(opacity="+p*100+")";
},insertBefore:function(elm,_45){
_45.parentNode.insertBefore(elm,_45);
return elm;
},setWidth:function(){
var _46=AJS.forceArray(arguments);
_46.splice(_46.length-1,0,"width");
AJS.setStyle.apply(null,_46);
},createArray:function(v){
if(AJS.isArray(v)&&!AJS.isString(v)){
return v;
}else{
if(!v){
return [];
}else{
return [v];
}
}
},isDict:function(o){
var _49=String(o);
return _49.indexOf(" Object")!=-1;
},isMozilla:function(){
return (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);
},removeEventListener:function(elm,_4b,fn,_4d){
var _4e="ajsl_"+_4b+fn;
if(!_4d){
_4d=false;
}
fn=elm[_4e]||fn;
if(elm["on"+_4b]==fn){
elm["on"+_4b]=elm[_4e+"old"];
}
if(elm.removeEventListener){
elm.removeEventListener(_4b,fn,_4d);
if(AJS.isOpera()){
elm.removeEventListener(_4b,fn,!_4d);
}
}else{
if(elm.detachEvent){
elm.detachEvent("on"+_4b,fn);
}
}
},callLater:function(fn,_50){
var _51=function(){
fn();
};
window.setTimeout(_51,_50);
},setTop:function(){
var _52=AJS.forceArray(arguments);
_52.splice(_52.length-1,0,"top");
AJS.setStyle.apply(null,_52);
},_createDomShortcuts:function(){
var _53=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","h4","h5","h6","br","textarea","form","p","select","option","optgroup","iframe","script","center","dl","dt","dd","small","pre","i"];
var _54=function(elm){
AJS[elm.toUpperCase()]=function(){
return AJS.createDOM.apply(null,[elm,arguments]);
};
};
AJS.map(_53,_54);
AJS.TN=function(_56){
return document.createTextNode(_56);
};
},addCallback:function(fn){
this.callbacks.unshift(fn);
},bindMethods:function(_58){
for(var k in _58){
var _5a=_58[k];
if(typeof (_5a)=="function"){
_58[k]=AJS.$b(_5a,_58);
}
}
},partial:function(fn){
var _5c=AJS.$FA(arguments);
_5c.shift();
return function(){
_5c=_5c.concat(AJS.$FA(arguments));
return fn.apply(window,_5c);
};
},isNumber:function(obj){
return (typeof obj=="number");
},getCssDim:function(dim){
if(AJS.isString(dim)){
return dim;
}else{
return dim+"px";
}
},isIe:function(){
return (navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1);
},removeClass:function(){
var _5f=AJS.forceArray(arguments);
var cls=_5f.pop();
var _61=function(o){
o.className=o.className.replace(new RegExp("\\s?"+cls,"g"),"");
};
AJS.map(_5f,function(elm){
_61(elm);
});
},setHTML:function(elm,_65){
elm.innerHTML=_65;
return elm;
},map:function(_66,fn,_68,_69){
var i=0,l=_66.length;
if(_68){
i=_68;
}
if(_69){
l=_69;
}
for(i;i<l;i++){
var val=fn(_66[i],i);
if(val!=undefined){
return val;
}
}
},addEventListener:function(elm,_6e,fn,_70,_71){
var _72="ajsl_"+_6e+fn;
if(!_71){
_71=false;
}
AJS.listeners=AJS.$A(AJS.listeners);
if(AJS.isIn(_6e,["keypress","keydown","keyup","click"])){
var _73=fn;
fn=function(e){
AJS.setEventKey(e);
return _73.apply(window,arguments);
};
}
var _75=AJS.isIn(_6e,["submit","load","scroll","resize"]);
var _76=AJS.$A(elm);
AJS.map(_76,function(_77){
if(_70){
var _78=fn;
fn=function(e){
AJS.REV(_77,_6e,fn);
return _78.apply(window,arguments);
};
}
if(_75){
var _7a=_77["on"+_6e];
var _7b=function(){
if(_7a){
fn(arguments);
return _7a(arguments);
}else{
return fn(arguments);
}
};
_77[_72]=_7b;
_77[_72+"old"]=_7a;
elm["on"+_6e]=_7b;
}else{
_77[_72]=fn;
if(_77.attachEvent){
_77.attachEvent("on"+_6e,fn);
}else{
if(_77.addEventListener){
_77.addEventListener(_6e,fn,_71);
}
}
AJS.listeners.push([_77,_6e,fn]);
}
});
},preloadImages:function(){
AJS.AEV(window,"load",AJS.$p(function(_7c){
AJS.map(_7c,function(src){
var pic=new Image();
pic.src=src;
});
},arguments));
},forceArray:function(_7f){
var r=[];
AJS.map(_7f,function(elm){
r.push(elm);
});
return r;
},update:function(l1,l2){
for(var i in l2){
l1[i]=l2[i];
}
return l1;
},getBody:function(){
return AJS.$bytc("body")[0];
},HTML2DOM:function(_85,_86){
var d=AJS.DIV();
d.innerHTML=_85;
if(_86){
return d.childNodes[0];
}else{
return d;
}
},getElement:function(id){
if(AJS.isString(id)||AJS.isNumber(id)){
return document.getElementById(id);
}else{
return id;
}
},showElement:function(){
var _89=AJS.forceArray(arguments);
AJS.map(_89,function(elm){
elm.style.display="";
});
},bind:function(fn,_8c,_8d){
fn._cscope=_8c;
return AJS._getRealScope(fn,_8d);
},createDOM:function(_8e,_8f){
var i=0,_91;
var elm=document.createElement(_8e);
var _93=_8f[0];
if(AJS.isDict(_8f[i])){
for(k in _93){
_91=_93[k];
if(k=="style"||k=="s"){
elm.style.cssText=_91;
}else{
if(k=="c"||k=="class"||k=="className"){
elm.className=_91;
}else{
elm.setAttribute(k,_91);
}
}
}
i++;
}
if(_93==null){
i=1;
}
for(var j=i;j<_8f.length;j++){
var _91=_8f[j];
if(_91){
var _95=typeof (_91);
if(_95=="string"||_95=="number"){
_91=AJS.TN(_91);
}
elm.appendChild(_91);
}
}
return elm;
},swapDOM:function(_96,src){
_96=AJS.getElement(_96);
var _98=_96.parentNode;
if(src){
src=AJS.getElement(src);
_98.replaceChild(src,_96);
}else{
_98.removeChild(_96);
}
return src;
},isDefined:function(o){
return (o!="undefined"&&o!=null);
}};
AJS.$=AJS.getElement;
AJS.$$=AJS.getElements;
AJS.$f=AJS.getFormElement;
AJS.$p=AJS.partial;
AJS.$b=AJS.bind;
AJS.$A=AJS.createArray;
AJS.DI=AJS.documentInsert;
AJS.ACN=AJS.appendChildNodes;
AJS.RCN=AJS.replaceChildNodes;
AJS.AEV=AJS.addEventListener;
AJS.REV=AJS.removeEventListener;
AJS.$bytc=AJS.getElementsByTagAndClassName;
AJS.$AP=AJS.absolutePosition;
AJS.$FA=AJS.forceArray;
AJS.addEventListener(window,"unload",AJS._unloadListeners);
AJS._createDomShortcuts();
AJS.Class=function(_9a){
var fn=function(){
if(arguments[0]!="no_init"){
return this.init.apply(this,arguments);
}
};
fn.prototype=_9a;
AJS.update(fn,AJS.Class.prototype);
return fn;
};
AJS.Class.prototype={extend:function(_9c){
var _9d=new this("no_init");
for(k in _9c){
var _9e=_9d[k];
var cur=_9c[k];
if(_9e&&_9e!=cur&&typeof cur=="function"){
cur=this._parentize(cur,_9e);
}
_9d[k]=cur;
}
return new AJS.Class(_9d);
},implement:function(_a0){
AJS.update(this.prototype,_a0);
},_parentize:function(cur,_a2){
return function(){
this.parent=_a2;
return cur.apply(this,arguments);
};
}};
script_loaded=true;


script_loaded=true;

//end of AJS.js
//start of AJS_fx.js

AJS.fx={_shades:{0:"ffffff",1:"ffffee",2:"ffffdd",3:"ffffcc",4:"ffffbb",5:"ffffaa",6:"ffff99"},highlight:function(_1,_2){
var _3=new AJS.fx.Base();
_3.elm=AJS.$(_1);
_3.options.duration=600;
_3.setOptions(_2);
AJS.update(_3,{increase:function(){
if(this.now==7){
_1.style.backgroundColor="#fff";
}else{
_1.style.backgroundColor="#"+AJS.fx._shades[Math.floor(this.now)];
}
}});
return _3.custom(6,0);
},fadeIn:function(_4,_5){
_5=_5||{};
if(!_5.from){
_5.from=0;
AJS.setOpacity(_4,0);
}
if(!_5.to){
_5.to=1;
}
var s=new AJS.fx.Style(_4,"opacity",_5);
return s.custom(_5.from,_5.to);
},fadeOut:function(_7,_8){
_8=_8||{};
if(!_8.from){
_8.from=1;
}
if(!_8.to){
_8.to=0;
}
_8.duration=300;
var s=new AJS.fx.Style(_7,"opacity",_8);
return s.custom(_8.from,_8.to);
},setWidth:function(_a,_b){
var s=new AJS.fx.Style(_a,"width",_b);
return s.custom(_b.from,_b.to);
},setHeight:function(_d,_e){
var s=new AJS.fx.Style(_d,"height",_e);
return s.custom(_e.from,_e.to);
}};
AJS.fx.Base=new AJS.Class({init:function(_10){
this.options={onStart:function(){
},onComplete:function(){
},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50};
AJS.update(this.options,_10);
AJS.bindMethods(this);
},setOptions:function(_11){
AJS.update(this.options,_11);
},step:function(){
var _12=new Date().getTime();
if(_12<this.time+this.options.duration){
this.cTime=_12-this.time;
this.setNow();
}else{
setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);
this.clearTimer();
this.now=this.to;
}
this.increase();
},setNow:function(){
this.now=this.compute(this.from,this.to);
},compute:function(_13,to){
var _15=to-_13;
return this.options.transition(this.cTime,_13,_15,this.options.duration);
},clearTimer:function(){
clearInterval(this.timer);
this.timer=null;
return this;
},_start:function(_16,to){
if(!this.options.wait){
this.clearTimer();
}
if(this.timer){
return;
}
setTimeout(AJS.$p(this.options.onStart,this.elm),10);
this.from=_16;
this.to=to;
this.time=new Date().getTime();
this.timer=setInterval(this.step,Math.round(1000/this.options.fps));
return this;
},custom:function(_18,to){
return this._start(_18,to);
},set:function(to){
this.now=to;
this.increase();
return this;
},setStyle:function(elm,_1c,val){
if(this.property=="opacity"){
AJS.setOpacity(elm,val);
}else{
AJS.setStyle(elm,_1c,val);
}
}});
AJS.fx.Style=AJS.fx.Base.extend({init:function(elm,_1f,_20){
this.parent();
this.elm=elm;
this.setOptions(_20);
this.property=_1f;
},increase:function(){
this.setStyle(this.elm,this.property,this.now);
}});
AJS.fx.Styles=AJS.fx.Base.extend({init:function(elm,_22){
this.parent();
this.elm=AJS.$(elm);
this.setOptions(_22);
this.now={};
},setNow:function(){
for(p in this.from){
this.now[p]=this.compute(this.from[p],this.to[p]);
}
},custom:function(obj){
if(this.timer&&this.options.wait){
return;
}
var _24={};
var to={};
for(p in obj){
_24[p]=obj[p][0];
to[p]=obj[p][1];
}
return this._start(_24,to);
},increase:function(){
for(var p in this.now){
this.setStyle(this.elm,p,this.now[p]);
}
}});
AJS.fx.Transitions={linear:function(t,b,c,d){
return c*t/d+b;
},sineInOut:function(t,b,c,d){
return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
}};
script_loaded=true;


script_loaded=true;

//end of AJS_fx.js*/


var GB_CURRENT=null;
GB_hide=function(cb){
GB_CURRENT.hide(cb);
};
GreyBox=new AJS.Class({init:function(_2){
this.use_fx=AJS.fx;
this.type="page";
this.overlay_click_close=false;
this.salt=0;
this.callback_fns=[];
this.reload_on_close=false;
this.src_loader="/loader_frame.php";
var _3=window.location.hostname.indexOf("www");
var _4=this.src_loader.indexOf("www");
if(_3!=-1&&_4==-1){
this.src_loader=this.src_loader.replace("://","://www.");
}
if(_3==-1&&_4!=-1){
this.src_loader=this.src_loader.replace("://www.","://");
}
this.show_loading=true;
AJS.update(this,_2);
},addCallback:function(fn){
if(fn){
this.callback_fns.push(fn);
}
},show:function(_6){
GB_CURRENT=this;
this.url=_6;
var _7=[AJS.$bytc("object"),AJS.$bytc("select")];
AJS.map(AJS.flattenList(_7),function(_8){
_8.style.visibility="hidden";
});
this.createElements();
return false;
},hide:function(cb){
var me=this;
AJS.callLater(function(){
var _b=me.callback_fns;
if(_b!=[]){
AJS.map(_b,function(fn){
fn();
});
}
me.onHide();
if(me.use_fx){
var _d=me.overlay;
AJS.fx.fadeOut(me.overlay,{onComplete:function(){
AJS.removeElement(_d);
_d=null;
},duration:300});
AJS.removeElement(me.g_window);
}else{
AJS.removeElement(me.g_window,me.overlay);
}
me.removeFrame();
AJS.REV(window,"scroll",_GB_setOverlayDimension);
AJS.REV(window,"resize",_GB_update);
var _e=[AJS.$bytc("object"),AJS.$bytc("select")];
AJS.map(AJS.flattenList(_e),function(_f){
_f.style.visibility="visible";
});
GB_CURRENT=null;
if(me.reload_on_close){
window.location.reload();
}
if(AJS.isFunction(cb)){
cb();
}
},10);
},update:function(){
this.setOverlayDimension();
this.setFrameSize();
this.setWindowPosition();
},createElements:function(){
this.initOverlay();
this.g_window=AJS.DIV({"id":"GB_window"});
AJS.hideElement(this.g_window);
AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);
this.initFrame();
this.initHook();
this.update();
var me=this;
if(this.use_fx){
AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){
me.onShow();
AJS.showElement(me.g_window);
me.startLoading();
}});
}else{
AJS.setOpacity(this.overlay,0.7);
AJS.showElement(this.g_window);
this.onShow();
this.startLoading();
}
AJS.AEV(window,"scroll",_GB_setOverlayDimension);
AJS.AEV(window,"resize",_GB_update);
},removeFrame:function(){
try{
AJS.removeElement(this.iframe);
}
catch(e){
}
this.iframe=null;
},startLoading:function(){
this.iframe.src=this.src_loader+"?s="+this.salt++;
AJS.showElement(this.iframe);
},setOverlayDimension:function(){
var _11=AJS.getWindowSize();
if(AJS.isMozilla()||AJS.isOpera()){
AJS.setWidth(this.overlay,"100%");
}else{
AJS.setWidth(this.overlay,_11.w);
}
var _12=Math.max(AJS.getScrollTop()+_11.h,AJS.getScrollTop()+this.height);
if(_12<AJS.getScrollTop()){
AJS.setHeight(this.overlay,_12);
}else{
AJS.setHeight(this.overlay,AJS.getScrollTop()+_11.h);
}
},initOverlay:function(){
this.overlay=AJS.DIV({"id":"GB_overlay"});
if(this.overlay_click_close){
AJS.AEV(this.overlay,"click",GB_hide);
}
AJS.setOpacity(this.overlay,0);
AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);
},initFrame:function(){
if(!this.iframe){
var d={"name":"GB_frame","class":"GB_frame","frameBorder":0};
if(AJS.isIe()){
d.src="javascript:false;document.write(\"\");";
}
this.iframe=AJS.IFRAME(d);
this.middle_cnt=AJS.DIV({"class":"content_gb"},this.iframe);
this.top_cnt=AJS.DIV();
this.bottom_cnt=AJS.DIV();
AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt);
}
},onHide:function(){
},onShow:function(){
},setFrameSize:function(){
},setWindowPosition:function(){
},initHook:function(){
}});
_GB_update=function(){
if(GB_CURRENT){
GB_CURRENT.update();
}
};
_GB_setOverlayDimension=function(){
if(GB_CURRENT){
GB_CURRENT.setOverlayDimension();
}
};
AJS.preloadImages("/images/indicator.gif");
script_loaded=true;
var GB_SETS={};
function decoGreyboxLinks(){
var as=AJS.$bytc("a");
AJS.map(as,function(a){
if(a.getAttribute("href")&&a.getAttribute("rel")){
var rel=a.getAttribute("rel");
if(rel.indexOf("gb_")==0){
var _17=rel.match(/\w+/)[0];
var _18=rel.match(/\[(.*)\]/)[1];
var _19=0;
var _1a={"caption":a.title||"","url":a.href};
if(_17=="gb_pageset"||_17=="gb_imageset"){
if(!GB_SETS[_18]){
GB_SETS[_18]=[];
}
GB_SETS[_18].push(_1a);
_19=GB_SETS[_18].length;
}
if(_17=="gb_pageset"){
a.onclick=function(){
GB_showFullScreenSet(GB_SETS[_18],_19);
return false;
};
}
if(_17=="gb_imageset"){
a.onclick=function(){
GB_showImageSet(GB_SETS[_18],_19);
return false;
};
}
if(_17=="gb_image"){
a.onclick=function(){
GB_showImage(_1a.caption,_1a.url);
return false;
};
}
if(_17=="gb_page"){
a.onclick=function(){
var sp=_18.split(/, ?/);
GB_show(_1a.caption,_1a.url,parseInt(sp[1]),parseInt(sp[0]));
return false;
};
}
if(_17=="gb_page_fs"){
a.onclick=function(){
GB_showFullScreen(_1a.caption,_1a.url);
return false;
};
}
if(_17=="gb_page_center"){
a.onclick=function(){
var sp=_18.split(/, ?/);
GB_showCenter(_1a.caption,_1a.url,parseInt(sp[1]),parseInt(sp[0]));
return false;
};
}
}
}
});
}
AJS.AEV(window,"load",decoGreyboxLinks);
GB_showImage=function(_1d,url,_1f){
var _20={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:_1d,callback_fn:_1f};
var win=new GB_Gallery(_20);
return win.show(url);
};
GB_showPage=function(_22,url,_24){
var _25={type:"page",caption:_22,callback_fn:_24,fullscreen:true,center_win:false};
var win=new GB_Gallery(_25);
return win.show(url);
};
GB_Gallery=GreyBox.extend({init:function(_27){
this.parent({});
this.img_close="/images/g_close.gif";
AJS.update(this,_27);
this.addCallback(this.callback_fn);
},initHook:function(){
AJS.addClass(this.g_window,"GB_Gallery");
var _28=AJS.DIV({"class":"inner"});
this.header=AJS.DIV({"class":"GB_header"},_28);
AJS.setOpacity(this.header,0);
AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);
var _29=AJS.TD({"id":"GB_caption","class":"caption","width":"40%"},this.caption);
var _2a=AJS.TD({"id":"GB_middle","class":"middle","width":"20%"});
var _2b=AJS.IMG({"src":this.img_close});
AJS.AEV(_2b,"click",GB_hide);
var _2c=AJS.TD({"class":"close","width":"40%"},_2b);
var _2d=AJS.TBODY(AJS.TR(_29,_2a,_2c));
var _2e=AJS.TABLE({"cellspacing":"0","cellpadding":0,"border":0},_2d);
AJS.ACN(_28,_2e);
if(this.fullscreen){
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
}else{
AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this));
}
},setFrameSize:function(){
var _2f=this.overlay.offsetWidth;
var _30=AJS.getWindowSize();
if(this.fullscreen){
this.width=_2f-40;
this.height=_30.h-80;
}
AJS.setWidth(this.iframe,this.width);
AJS.setHeight(this.iframe,this.height);
AJS.setWidth(this.header,_2f);
},_setHeaderPos:function(){
AJS.setTop(this.header,AJS.getScrollTop()+10);
},setWindowPosition:function(){
var _31=this.overlay.offsetWidth;
var _32=AJS.getWindowSize();
AJS.setLeft(this.g_window,((_31-50-this.width)/2));
var _33=AJS.getScrollTop()+55;
if(!this.center_win){
AJS.setTop(this.g_window,_33);
}else{
var fl=((_32.h-this.height)/2)+20+AJS.getScrollTop();
if(fl<0){
fl=0;
}
if(_33>fl){
fl=_33;
}
AJS.setTop(this.g_window,fl);
}
this._setHeaderPos();
},onHide:function(){
AJS.removeElement(this.header);
AJS.removeClass(this.g_window,"GB_Gallery");
},onShow:function(){
if(this.use_fx){
AJS.fx.fadeIn(this.header,{to:1});
}else{
AJS.setOpacity(this.header,1);
}
}});
AJS.preloadImages("/images/g_close.gif");
GB_showFullScreenSet=function(set,_36,_37){
var _38={type:"page",fullscreen:true,center_win:false};
var _39=new GB_Sets(_38,set);
_39.addCallback(_37);
_39.showSet(_36-1);
return false;
};
GB_showImageSet=function(set,_3b,_3c){
var _3d={type:"image",fullscreen:false,center_win:true,width:300,height:300};
var _3e=new GB_Sets(_3d,set);
_3e.addCallback(_3c);
_3e.showSet(_3b-1);
return false;
};
GB_Sets=GB_Gallery.extend({init:function(_3f,set){
this.parent(_3f);
if(!this.img_next){
this.img_next="/images/next.gif";
}
if(!this.img_prev){
this.img_prev="/images/prev.gif";
}
this.current_set=set;
},showSet:function(_41){
this.current_index=_41;
var _42=this.current_set[this.current_index];
this.show(_42.url);
this._setCaption(_42.caption);
this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});
this.btn_next=AJS.IMG({"class":"right",src:this.img_next});
AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));
AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));
GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});
AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);
this.updateStatus();
},updateStatus:function(){
AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);
if(this.current_index==0){
AJS.addClass(this.btn_prev,"disabled");
}else{
AJS.removeClass(this.btn_prev,"disabled");
}
if(this.current_index==this.current_set.length-1){
AJS.addClass(this.btn_next,"disabled");
}else{
AJS.removeClass(this.btn_next,"disabled");
}
},_setCaption:function(_43){
AJS.setHTML(AJS.$("GB_caption"),_43);
},updateFrame:function(){
var _44=this.current_set[this.current_index];
this._setCaption(_44.caption);
this.url=_44.url;
this.startLoading();
},switchPrev:function(){
if(this.current_index!=0){
this.current_index--;
this.updateFrame();
this.updateStatus();
}
},switchNext:function(){
if(this.current_index!=this.current_set.length-1){
this.current_index++;
this.updateFrame();
this.updateStatus();
}
}});
AJS.AEV(window,"load",function(){
AJS.preloadImages("/images/next.gif","/images/prev.gif");
});
GB_show=function(_45,url,_47,_48,_49){
var _4a={caption:_45,height:_47||500,width:_48||500,fullscreen:false,callback_fn:_49};
var win=new GB_Window(_4a);
return win.show(url);
};
GB_showCenter=function(_4c,url,_4e,_4f,_50){
var _51={caption:_4c,center_win:true,height:_4e||500,width:_4f||500,fullscreen:false,callback_fn:_50};
var win=new GB_Window(_51);
return win.show(url);
};
GB_showFullScreen=function(_53,url,_55){
var _56={caption:_53,fullscreen:true,callback_fn:_55};
var win=new GB_Window(_56);
return win.show(url);
};
GB_Window=GreyBox.extend({init:function(_58){
this.parent({});
this.img_header="/images/header_bg.gif";
this.img_close="/images/w_close.gif";
this.show_close_img=true;
AJS.update(this,_58);
this.addCallback(this.callback_fn);
},initHook:function(){
AJS.addClass(this.g_window,"GB_Window");
this.header=AJS.TABLE({"class":"header_gb"});
this.header.style.backgroundImage="url("+this.img_header+")";
var _59=AJS.TD({"class":"caption"},this.caption);
var _5a=AJS.TD({"class":"close"});
if(this.show_close_img){
var _5b=AJS.IMG({"src":this.img_close});
var _5c=AJS.SPAN("Close");
var btn=AJS.DIV(_5b,_5c);
AJS.AEV([_5b,_5c],"mouseover",function(){
AJS.addClass(_5c,"on");
});
AJS.AEV([_5b,_5c],"mouseout",function(){
AJS.removeClass(_5c,"on");
});
AJS.AEV([_5b,_5c],"mousedown",function(){
AJS.addClass(_5c,"click");
});
AJS.AEV([_5b,_5c],"mouseup",function(){
AJS.removeClass(_5c,"click");
});
AJS.AEV([_5b,_5c],"click",GB_hide);
AJS.ACN(_5a,btn);
}
tbody_header=AJS.TBODY();
AJS.ACN(tbody_header,AJS.TR(_59,_5a));
AJS.ACN(this.header,tbody_header);
AJS.ACN(this.top_cnt,this.header);
if(this.fullscreen){
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
}
},setFrameSize:function(){
if(this.fullscreen){
var _5e=AJS.getWindowSize();
overlay_h=_5e.h;
this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);
this.height=Math.round(overlay_h-(overlay_h/100)*10);
}
AJS.setWidth(this.header,this.width+6);
AJS.setWidth(this.iframe,this.width);
AJS.setHeight(this.iframe,this.height);
},setWindowPosition:function(){
var _5f=AJS.getWindowSize();
AJS.setLeft(this.g_window,((_5f.w-this.width)/2)-13);
if(!this.center_win){
AJS.setTop(this.g_window,AJS.getScrollTop());
}else{
var fl=((_5f.h-this.height)/2)-20+AJS.getScrollTop();
if(fl<0){
fl=0;
}
AJS.setTop(this.g_window,fl);
}
}});
AJS.preloadImages("/images/w_close.gif","/images/header_bg.gif");


script_loaded=true;

//end of gbscripts.js

function check_all_locations(frm,sel,val)
{

	for(i=0;i<eval("document." + frm + ".elements.length");i++)

	{


		nam = eval("document." + frm + ".elements[" + i + "].name");

		if(nam.substring(0,8)==val)

		{

			eval("document." + frm + ".elements[" + i + "].checked = " + sel.checked);
		
		}
		
	}	
}	

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

//141008
function chk_event(frmname)
{

	var msg="", dc;
   
    dc=eval("document."+frmname);
			
	if(dc.user_id.value.length==0)
		msg += "Please choose a user!\n";
		
	if(dc.title.value.length == 0)
	   msg += "Please enter Title!\n";
	   
	if(dc.category.value.length == 0)
	   msg += "Please Choose a Category!\n";   
	
	if(dc.short_description.value.length == 0)
	   msg += "Please enter Short Description!\n";
	else if(dc.short_description.value.length >255)
		msg += "Short Description exceeds the maximum char limit!\n";	
	   
	if(dc.description.value.length == 0)
	   msg += "Please enter Long Description!\n";   
	  
	if(dc.website.value.length >0)
	{
	
		web_arr=dc.website.value.split("http://");
		
		if(web_arr.length <= 1)
			msg += "Please add http:// infront of website!\n";
	}
	
	if(dc.venue.value.length == 0)
	   msg += "Please enter Venue Name!\n";
	   
	if(dc.venue_street.value.length == 0)
	   msg += "Please enter Venue Street!\n";
		
	if(dc.city.value<=0 && dc.unapproved_city.value<=0)//231008
	   msg += "Please choose Venue Town!\n";
	      
	if(dc.venue_zip.value.length == 0)
	   msg += "Please enter Venue Postcode!\n"; 
	   
	if(dc.organisation.value.length == 0)
	   msg += "Please enter Organisation!\n";
	   
	if(dc.contact_name.value.length == 0)
	   msg += "Please enter Contact Person!\n";
	   
	if(dc.designation.value.length == 0)
	   msg += "Please enter Position in Business!\n";
	   
	if(dc.street.value.length == 0)
	   msg += "Please enter Street!\n"; 
	   
	if(dc.zip.value.length == 0)
	   msg += "Please enter Postcode!\n";    
	   
	if(dc.phone.value.length == 0)
	   msg += "Please enter Contact Phone!\n";                            
	      
	if(dc.email.value.length == 0)
	   msg += "Please enter Contact Email!\n";
	
    else if(!chk_email(dc.email))
	   msg += "Please enter a valid email address!\n";
		
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
		
}

function chk_cat_max(frmname)
 {
  	 var dc, count=0;
	 
	 dc=eval("document."+frmname);
	 
	 for(i=0;i<dc.elements.length;i++)
	 {
	 
	 	if(dc.elements[i].name=="eventcat_ids[]")
		{
		
			if(dc.elements[i].checked && count < 3)
				count++;				
			
			if(count > 2)
			{				
				alert("You can select maximum 2 categories!");					
				dc.elements[i].checked=false;
				break;
			}				
		}
	 }
  }
  
  function setid(obj,fld){



	if(obj.checked){

		//document.frm_search.checkids.value += obj.value+";";


		fld.value += obj.value+";";


	}else{


		//arr_str = document.frm_search.checkids.value;


		arr_str = fld.value;


		arr = arr_str.split(";");


		str = "";


		for(i=0;i<arr.length;i++){


			if(arr[i] != obj.value){


				if(arr[i].length > 0){


					str = str + arr[i] + ";";

				}


			}


		}


		//document.frm_search.checkids.value = str;

		fld.value = str;


	}


}

//	TO SELECT FROM SELECTION BOX
function show_selected(obj,val)
{

//obj = document.frmname.fieldname

//val=actual value <?php echo $obj->country; ?>

  var len=obj.options.length

  for(var i=0;i<len;i++)

  {

    if(obj.options[i].value==val)

     {


       obj.selectedIndex=i;

     }

  } 

}

function chk_parent(obj, frmname)
{

	var dc;
	
	dc=eval("document."+frmname);
	
	val_arr=obj.value.split("-");
	
	if(frmname=="event_srch_frm")
		dc.head_category.value=val_arr[0];
	else
		document.frm_event.category.value=val_arr[0];	
	
	if(val_arr[1] > 0)
	{				
		if(frmname!="event_srch_frm")
			dc.catid.value=val_arr[0];								
		else
		{
			dc.action='';		
			dc.srch_parent_cat.value=val_arr[0];
		}			
		dc.submit();
	}
	else
	{	
		if(document.getElementById('head_subcategory'))	
			document.getElementById('head_subcategory').disabled=true;
	}	
}

/*function chk_parent1(obj, frmname)
{

	var dc;
	
	dc=eval("document."+frmname);
	
	val_arr=obj.value.split("-");

	dc.head_category.value=val_arr[0];
	
	if(val_arr[1] > 0)
	{
		dc.action='';		
		dc.srch_parent_cat.value=val_arr[0];		
		dc.submit();
	}
	else
	{		
		document.getElementById('head_subcategory').disabled=true;
	}	
}*/

//121108

function hide_div(obj) {


//190805 -  "hide_div" function is fixed in same manner as it is did in advanced search. - Start

var div_arr = document.getElementsByTagName("div");


		for(i=0;i<div_arr.length;i++)
		{
			if(div_arr[i].getAttribute("id") == "search")
			{
				div_arr[i].style.display="none";
			}
		}


//190805 -  "hide_div" function is fixed in same manner as it is did in advanced search. - End


		//search.style.display="none";



}


function show_div(obj) {

//190805 - Advanced link in search form on admin panel has been fixed. This is first done in ip. "hide_div" function is to be fixed in same manner. - Start

var div_arr = document.getElementsByTagName("div");


		for(i=0;i<div_arr.length;i++)
		{
			if(div_arr[i].getAttribute("id") == "search")
			{
				div_arr[i].style.display="inline";
			}
		}


//190805 - Advanced link in search form on admin panel has been fixed. This is first done in ip. "hide_div" function is to be fixed in same manner. - End

		//search.style.display="inline";


}

//281108
function chk_propery_agent(frmname)
{

	var dc = eval("document." + frmname);
	var msg = "";
	
	if(dc.firstname.value.length == 0)
		msg+= "Agent Name : can not be blank.\n";		
	
	if(dc.website.value.length > 0)
	{
		if(dc.website.value.substring(0,7)!= "http://")
			msg += "Website: Please enter a complete URL including http://\n";
	}	
	
	if(dc.phone.value.length == 0)
		msg+= "Primary Phone : can not be blank.\n";			
	
	if(dc.email.value.length > 0 && !chk_email(dc.email))
		msg += "Agent Email : Please enter a valid email address.\n";

	if(dc.financing_url.value.length > 0)
	{
		if(dc.financing_url.value.substring(0,7) != "http://")
			msg += "Financial URL: Please enter a complete URL including http://\n";
	}
	
	if(dc.prequalification_url.value.length > 0)
	{
		if(dc.prequalification_url.value.substring(0,7) != "http://")
			msg += "Prequalification URL: Please enter a complete URL including http://\n";
	}			
						
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
}

function chk_propery_broker(frmname)
{

	var dc = eval("document." + frmname);
	var msg = "";
	
	if(dc.firstname.value.length == 0)
		msg+= "Brokerage Name : can not be blank.\n";		
	
	if(dc.email.value.length > 0 && !chk_email(dc.email))
		msg += "Email : Please enter a valid email address.\n";//210109
		
	if(dc.website.value.length > 0)
	{
		if(dc.website.value.substring(0,7) != "http://")
			msg += "Website: Please enter a complete URL including http://\n";
	}	
									
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
}

function chk_property_city(frmname)
{

	var msg="",dc;

	dc=eval("document."+frmname);
		
	set_field('location_frm','cityval',dc.cityname.value);
	set_field('location_frm','stateval',dc.state.value);
				
	if(dc.state.value <=0)
		msg+="Please choose a State\n";	

	if(dc.cityname.value.length < 2) //180708
			
		msg+="Please enter atleaset 2 characters of your city\n";
		
	if(msg.length >0)
		alert(msg);
	else	
		document.location_frm.submit(); 
				
		
}	

function addpropertycity(hid_val,city_name, frmname)
{
	if(frmname.length > 0)
		frm=frmname;
	else
		frm="property_frm";
		
	var winopener;
			
	winopener=eval("window.opener.document."+frm);
		
		winopener.city.value = hid_val;
		window.opener.document.getElementById('city').innerHTML = city_name;
	    		
		window.opener.focus();
		
		window.close();
}		

function chk_owner_frm(frmname)
{

	var msg="", dc = eval('document.' + frmname);
	
	if(dc.firstname.value.length == 0)
		msg += "First Name : can not be blank.\n";
		
	if(dc.lastname.value.length == 0)
		msg += "Last Name : can not be blank.\n";	
		
	if(dc.phone.value.length == 0)
		msg += "Phone : can not be blank.\n";
	
	if(dc.email.value.length > 0 && !chk_email(dc.email))
		msg += "Email : Please enter a valid email address.\n";
				
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
}

function chk_propert_frm(frmname)
{

	var msg="", dc = eval('document.' + frmname);
	
	if(dc.title.value.length == 0)
		msg+= "Ad Title : can not be blank.\n";
		
	if(dc.status.value.length == 0)
		msg+= "Please choose a Status!\n";	
		
	if(dc.property_description.value.length == 0)
		msg+="Description : can not be blank.\n";
	else
	{
	
		if(dc.property_description.value.length > 1500)
			msg+="Description should be less than 1500 chars";
	}	
	
	if(dc.price.value.length == 0)
		msg+= "Price : can not be blank.\n";
	else
	{
	
		if(isNaN(dc.price.value))
		{
			msg+="Price : enter in digits.\n";
			dc.price.focus();
		}	
		else if(dc.price.value < 0)
		{
			msg+="Price : enter greater than 0.\n";	
			dc.price.focus();
		}	
	}	
	
	if(dc.acreage.value.length == 0)
		msg+= "Acreage : can not be blank.\n";	
	
	if(dc.city.value<=0 && dc.unapproved_city.value<=0)
		msg+= "City : can not be blank.\n";
		
	if(dc.zip.value.length == 0)
		msg+= "Zip/Postcode : can not be blank.\n";		
	
	//040509						
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
	{
		video_code=dc.url.value;
		if(video_code.length > 0)
		{
			save_code=true;
				
			if(video_code.substring(0,7)!="<object" || video_code.substring(video_code.length-9, video_code.length)!="</object>")
				save_code=false;
			
			if(save_code)
			{
				arr= new Array();
			
				arr[0]='<param name="movie"';
				arr[1]='value="http://www.youtube.com/';
				arr[2]='<embed';	
				arr[3]='src="http://www.youtube.com/';
				arr[4]='</embed>';
							
				for(i=0;i<arr.length;i++)
				{
				
					val=video_code.split(arr[i]);
					
					if(val.length<=1)
					{
						save_code=false;
						break;
					}
				}		
			}
						
			if(!save_code)
				dc.url.value='';		
		}
		
		return true;
	}	
} //040509

var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}


function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		//alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date")
		return false
	}
return true
}

function chk_open_day(frmname)
{

	var dc = eval("document." + frmname);
	var msg = "", open_dt=1;
			
	if(dc.open_dates.value.length > 0)
	{		
		if(!isDate(dc.open_dates.value))
			open_dt = 0;
	}

	if(open_dt == 0)
		msg += "Please enter a date in the following format: mm/dd/yyyy.\n";
	
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
	{
		//need to set dates as per the db format
		/*if(dc.open_dates.value.length > 0)
			dc.open_dates.value = date_dbformat(dc.open_dates.value,"/");		*/
		return true;
	}		

}

//111208 - v3flash(slideshow.js) js code -start

/**
 * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formarly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;


/**
 * XML Flash Slideshow v3: Slideshow embed script
 *
 * This software is (c) 2006 DWUser.com
 * http://www.dwuser.com/ 
 */
 
XMLFlashSlideshow_v3 = function(p)
{
	try{
	if (p.id==undefined){
	var id = 'v3flashslideshow_' + (new Date().getTime()) + '_' + Math.random();
	document.write('<div id="' + id + '"><strong><a href="http://www.adobe.com/go/getflashplayer/">You need to upgrade your Flash Player and enable JavaScript to view this content &raquo;</a></strong></div>');
	}else{var id = p.id};
	var so = new SWFObject(p.swf,id,p.w,p.h,'7','#FFFFFF');
	so.addParam('wmode', 'transparent');
	if (p.redirect&&p.redirect!=''&&p.redirect!='NONE') so.setAttribute('redirectUrl',p.redirect);
	so.addVariable('usePreloader',p.usePreloader);
	so.addVariable('xml',escape(p.xml));
	so.addVariable('preventCache',p.preventCache);
	so.addVariable('disableMultipleXML',p.disableMultipleXML);
	so.addVariable('initXML',p.initXML);
	so.write(id);
	}catch(e){}
}

//slideshow.js - end

//codethatcalendarstd.js code start




function UA(){var t=this,nv=navigator,n=nv.userAgent.toLowerCase();t.win=n.indexOf('win')>=0;t.mac=n.indexOf('mac')>=0;t.DOM=document.getElementById?true:false;t.dynDOM=document.createElement&&document.addEventListener;t.khtml=nv.vendor=='KDE';var idx=n.indexOf('opera');t.opera=idx!=-1;if(t.opera){t.vers=parseFloat(n.substr(idx+6));t.major=Math.floor(t.vers);t.opera5=t.major==5;t.opera6=t.major==6;t.opera7=t.major==7;t.opera7up=t.vers>=7;}t.oldOpera=t.opera5||t.opera6;idx=n.indexOf('msie');if(idx>=0&&!t.opera&&!t.khtml){t.vers=parseFloat(n.substr(idx+5));t.ie3down=t.vers<4;t.ie=t.ie4up=document.all&&document.all.item&&!t.ie3down;t.ie5up=t.ie&&t.DOM;t.ie55up=t.ie&&t.vers>=5.5;t.ie6up=t.ie&&t.vers>=6}t.cm=document.compatMode;t.css1cm=t.cm=='CSS1Compat';t.nn4=nv.appName=="Netscape"&&!t.DOM&&!t.opera;if(t.nn4)t.vers=parseFloat(nv.appVersion);t.moz=t.nn6up=t.gecko=n.indexOf('gecko')!=-1;if(t.gecko)t.vers=parseFloat(n.substr(n.indexOf('rv:')+3));t.nn7up=t.gecko&&t.vers>1;t.hj=n.indexOf('hotjava')!=-1;t.aol=n.indexOf('aol')!=-1;t.aol4up=t.aol&&t.ie4up;t.major=Math.floor(t.vers);t.supp=t.supported=t.oldOpera||t.opera7up||t.ie||t.moz||t.nn4||t.DOM};function Undef(o){
return typeof(o)=='undefined'||o===''||o==null};function Def(o){
return!Undef(o)};var ua=new UA();function CodeThatSetMY(m,y,f){switch(f){case 0:{++m;if(m==12){m=0;y++;}break;}case 1:{--m;if(m==-1){m=11;y--;}break;}case 2:{++y;break;}case 3:{--y;break;}case 4:{break;}}if(!window.opener)window.opener=window.parent;var c;if(ua.moz&&ua.vers>=1.4){if(this.opener)c=this.opener.codethatcalendar;else c=this.parent.codethatcalendar;window.opener=this.parent;}else if(window.opener)c=window.opener.codethatcalendar;if(c){c.date.setFullYear(y);c.date.setMonth(m);}location.reload();};function CodeThatFind(d,f){if(d.getElementById&&Def(d.getElementById(f))){
return d.getElementById(f);}else if(ua.ie4up){
return d.all[f];}else{if(d.forms.item)for(var i=0;d.forms.item(i)!=null;++i){if(d.forms.item(i).namedItem&&d.forms.item(i).namedItem(f))
return d.forms.item(i).namedItem(f);if(d.forms.item(i).elements&&d.forms.item(i).elements[f])
return d.forms.item(i).elements[f];}for(var form in d.forms)if(d.forms[form].elements&&d.forms[form].elements[f])
return d.forms[form].elements[f];}
return null;};function CodeThatAlign(n){
return n<10?("0"+n):(""+n);;};function CodeThatDateFormat(f,d,m,y){var s=f;d=d<10?("0"+d):d;s=s.replace("dd",d);m++;m=m<10?("0"+m):m;s=s.replace("MM",m);s=s.replace("yyyy",y);if(CodeThatFind(document,'time')){var t=CodeThatFind(document,'time').value;var hours=parseInt(t.substring(0,2)-0);if(hours<0||hours>23){hours=hours%24;hours+=(hours<0?24:0);}s=s.replace("HH",CodeThatAlign(hours));var minutes=parseInt(t.substring(3,5)-0);if(minutes<0||minutes>59){minutes=minutes%60;minutes+=(minutes<0?60:0);}s=s.replace("mm",CodeThatAlign(minutes));var seconds=parseInt(t.substring(6,8)-0);if(seconds<0||seconds>59){seconds=seconds%60;seconds+=(seconds<0?60:0);}s=s.replace("ss",CodeThatAlign(seconds));}
return s;};function CodeThatSetDay(c,f,d,m,y,i,ifr){var doc;var w=window.opener||this.parent;if(w&&!i)doc=w.document;else doc=document;var e=CodeThatFind(doc,c);if(Def(e)){e.value=CodeThatDateFormat(f,d,m,y);if(e.onchange)e.onchange();}if(w&&!i){if(Def(w)&&Def(ifr)){var iframe=CodeThatFind(doc,ifr);if(Def(iframe))iframe.style.visibility='hidden';if(ua.opera6){var d=CodeThatFind(doc,"calendar_div");if(Def(d))d.style.visibility='hidden';}}else{window.close();}}};function CodeThatCalendar(def){this.def=def;this.links={};this.styles={};this.hideifr=true;};{var CTc=CodeThatCalendar.prototype;CTc.getCss=function(key,d){
return "";};CTc.hide=function(){if(window.parent&&this.hideifr&&this.ifr){var iframe=CodeThatFind(window.parent.document,this.ifr);if(iframe)iframe.style.visibility='hidden';}};CTc.create=function(d,ctl){var i=false;this.i=i;if(!this.date)this.date=window.date||new Date();var def=this.def;var acts='';if(this.ifr&&def.headerstyle.type!="comboboxes"){acts='onMouseOver="window.parent.codethatcalendar.hideifr=false;"';acts+=" onMouseOut=\"window.parent.codethatcalendar.hideifr=true;setTimeout('window.parent.codethatcalendar.hide();',1000);\""}d.write("<table "+(Def(this.ifr)?"align=\"center\"":"")+" cellspacing=0 cellpadding=0 "+acts+" width="+def.width+" border="+(def.border_width||0)+" bordercolor='"+(def.border_color||'#000000')+"'>");d.write("<tr>");if(i)this.createButtons(d,i);else{if(def.headerstyle.type=="buttons")this.createButtons(d,i);else if(def.headerstyle.type=="comboboxes")this.createCombos(d);}d.write("</tr>");var day=0;d.write("<tr>");this.createWeekdays(d);d.write("</tr>");var w=this.createMonth(d);if(def.showtime){this.createTime(d);}if(ua.opera&&w==4){d.write("<tr><td colspan=7>&nbsp;<td></tr>");}d.write("</table>");};CTc.createTime=function(d){d.write("<tr><td colspan=7 align=center>"+(ua.nn4?"<form>":"")+"<input "+(ua.nn4?"name":"id")+"='time' type=textarea value='"+CodeThatAlign(this.date.getHours())+":"+CodeThatAlign(this.date.getMinutes())+":"+CodeThatAlign(this.date.getSeconds())+"'>"+(ua.nn4?"</form>":"")+"</td></tr>");};CTc.createMonth=function(d){var cd=this.date.getDate();var cm=this.date.getMonth();var cy=this.date.getYear();var cday=this.date.getDay();var def=this.def;var cur_day=1;this.date.setDate(cur_day);var thisweek=false;var start=(this.date.getDay()-def.firstday);start+=(start<0?7:0);cur_day-=start;var css,thismonth=false,weekend,thisday;var w;for(w=0;w<6;++w){d.write("<tr>");for(var day=0;day<7;++day){weekend=day+def.firstday;weekend-=(weekend<7?0:7);weekend=weekend==0||weekend==6;this.date.setDate(cur_day);if(this.date.getDate()==1)thismonth=!thismonth;if(day==0){if(w!=0){thisweek=cd-this.date.getDate();if(thisweek<7&&thisweek>=0)thisweek=true;else thisweek=false;}else thisweek=(start+cd)<8;}if(day==7&&thisweek)thisweek=false;thisday=this.date.getDate()==cd&&thismonth;css=thisday?"cd_css":(thisweek?"tw_css":(thismonth?(weekend?"we_css":"wd_css"):(weekend?"weom_css":"wdom_css")));d.write("<td align=center width=14% "+this.getCss(css)+"><A "+this.getCss(css)+this.getRef()+">");d.write(this.date.getDate());d.write("</A></td>");cur_day=this.date.getDate()+1;}d.write("</tr>");this.date.setDate(cur_day);if(this.date.getDate()<8&&w>3)break;}this.date.setDate(cd);this.date.setMonth(cm);this.date.setYear(cy);
return w;};CTc.setLink=function(s,l){this.links[s]=l;};CTc.setStyle=function(s,l){this.styles[s]=l;};CTc.getStyle=function(){var c;if(this.i){var fd=CodeThatDateFormat(this.def.dtype,this.date.getDate(),this.date.getMonth(),this.date.getFullYear());if(this.styles[fd])c=this.styles[fd];}
return c;};CTc.getRef=function(){var ref;if(this.i){var fd=CodeThatDateFormat(this.def.dtype,this.date.getDate(),this.date.getMonth(),this.date.getFullYear());if(this.links[fd])ref=" href='"+this.links[fd]+"'";}ref=ref||(" href='javascript:CodeThatSetDay(\""+this.ctl+"\",\""+this.def.dtype+"\","+this.date.getDate()+","+this.date.getMonth()+","+this.date.getFullYear()+","+this.i+",\""+(Def(this.ifr)?this.ifr:"")+"\")'");
return ref;};CTc.createWeekdays=function(d){var def=this.def;var weekend;for(var day=0;day<7;++day){weekend=day+def.firstday;weekend-=(weekend<7?0:7);d.write("<td align=center "+this.getCss("dn_css")+">"+def.daynames[weekend]+"</td>");}};CTc.createButtons=function(d,i){var col=9,dh=this.def.headerstyle;for(var p in dh)--col;if(dh.imgprevy&&!i)d.write("<td width=14% align=left><a href='javascript:CodeThatSetMY("+this.date.getMonth()+","+this.date.getFullYear()+",3)'><IMG border=0 src='"+dh.imgprevy+"'</IMG></A>");if(dh.imgprevm&&!i)d.write("<td width=14% align=left><a href='javascript:CodeThatSetMY("+this.date.getMonth()+","+this.date.getFullYear()+",1)'><IMG border=0 src='"+dh.imgprevm+"'</IMG></A>");d.write("<td colspan="+col+" align=center "+this.getCss("css",dh)+">"+this.def.monthnames[this.date.getMonth()]+"&nbsp;"+this.date.getFullYear()+"</td>");if(dh.imgnextm&&!i)d.write("<td width=14% align=right><a href='javascript:CodeThatSetMY("+this.date.getMonth()+","+this.date.getFullYear()+",0)'><IMG border=0 src='"+dh.imgnextm+"'</IMG></A></td>");if(dh.imgnexty&&!i)d.write("<td width=14% align=right><a href='javascript:CodeThatSetMY("+this.date.getMonth()+","+this.date.getFullYear()+",2)'><IMG border=0 src='"+dh.imgnexty+"'</IMG></A></td>");};CTc.createCombos=function(d,l){var dh=this.def.headerstyle;d.write("<td colspan=7 "+this.getCss("css",dh)+">");if(ua.nn4)d.write("<form>");d.write("<select align=left "+this.getCss("css",dh)+" "+(ua.nn4?"name":"id")+"='month' onchange='CodeThatSetMY(CodeThatFind(document,\"month\").selectedIndex,"+dh.yearrange[0]+"+CodeThatFind(document,\"year\").selectedIndex,4);'>");var i=0;for(;i<12;++i)d.write("<option "+(i==this.date.getMonth()?"selected='selected'":"")+" value='"+i+"'>"+this.def.monthnames[i]+"</option>");d.write("</select>");d.write("<select align=right "+this.getCss("css",dh)+" "+(ua.nn4?"name":"id")+"='year' onchange='CodeThatSetMY(CodeThatFind(document,\"month\").selectedIndex,"+dh.yearrange[0]+"+CodeThatFind(document,\"year\").selectedIndex,4);'>");for(i=dh.yearrange[0];i<=dh.yearrange[1];++i)d.write("<option "+(i==this.date.getFullYear()?"selected='selected'":"")+" value='"+i+"'>"+i+"</option>");d.write("</select>");if(ua.nn4)d.write("</form>");d.write("</td>");};CTc.parseValue=function(s,d){var f=this.def.dtype;d=d||this.date;var t;if(f.indexOf("yyyy")!=-1){t=parseInt(s.substr(f.indexOf("yyyy"),4)-0);if(!isNaN(t)&&typeof(t)!='undefined')d.setFullYear(t);}if(f.indexOf("MM")!=-1){t=parseInt(s.substr(f.indexOf("MM"),2)-1);if(!isNaN(t)&&typeof(t)!='undefined')d.setMonth(t);}if(f.indexOf("dd")!=-1){t=parseInt(s.substr(f.indexOf("dd"),2)-0);if(!isNaN(t)&&typeof(t)!='undefined')d.setDate(t);}if(f.indexOf("HH")!=-1){t=parseInt(s.substr(f.indexOf("HH"),2)-0);if(!isNaN(t)&&typeof(t)!='undefined')d.setHours(t);}if(f.indexOf("mm")!=-1){t=parseInt(s.substr(f.indexOf("mm"),2)-0);if(!isNaN(t)&&typeof(t)!='undefined')d.setMinutes(t);}if(f.indexOf("ss")!=-1){t=parseInt(s.substr(f.indexOf("ss"),2)-0);if(!isNaN(t)&&typeof(t)!='undefined')d.setSeconds(t);}};CTc.popup=function(ctl){window.codethatcalendar=this;this.ctl=ctl;var e=CodeThatFind(document,ctl);this.date=new Date();if(e.value!="")this.parseValue(e.value);var w=window.open("/codethatcalendar.html","",'width='+this.def.windoww+',height='+this.def.windowh+',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes');w.opener=window;w.focus();};CTc.innerpopup=function(ctl,ifr){window.codethatcalendar=this;this.ctl=ctl;this.ifr=ifr;this.hideifr=false;var e=CodeThatFind(document,ctl);this.date=new Date();if(e.value!="")this.parseValue(e.value);var w=CodeThatFind(document,ifr);if(ua.oldOpera){w=document.frames[ifr];w.location.reload();var d=CodeThatFind(document,"calendar_div");d.style.visibility='visible';}else{w.src="codethatcalendar_ifr.html";w.style.visibility='visible';}w.opener=window;w.height=this.def.windowh;w.width=this.def.windoww;if(ua.moz){}else{w.focus();}};}

//codethatcalendarstd.js code end

//box_ex.js start
var caldef2 = {
			firstday:0,
			dtype:'MM/dd/yyyy',
			width:250,
			windoww:300,
			windowh:200,
			border_width:0,
			border_color:'#0000d3',
			dn_css:'clsDayName',
                        cd_css:'clsCurrentDay',
			wd_css:'clsWorkDay',
			we_css:'clsWeekEnd',
			wdom_css:'clsWorkDayOtherMonth',
			weom_css:'clsWeekEndOtherMonth',
			headerstyle: {
				type:"comboboxes",
				css:'clsWorkDayOtherMonth',
				yearrange:[2004,2015]
			},
			monthnames :["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
			daynames : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
};

//box_ex.js end
//121208
function chk_listitem(frmname)
{

	var dc = eval("document." + frmname);
	var msg = "";

	if(dc.txt_title.value.length == 0)
		msg += "Name : can not be blank.\n";
	
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
	{
		return true;
	}

}

//131208
function chk_property_email()
{

	var msg="";
	
	dc=eval("document.email_frm");
	
	if(dc.email.value.length==0)
		msg+="Please enter your Email\n";
	else
	{	
		if(!chk_email(dc.email))
			msg += "Please enter a valid email address.\n";
	}	
	
	if(dc.subject.value.length==0)
		msg+="Please enter Subject\n";
	
	if(dc.enquiry.value.length==0)
		msg+="Please enter Enquiry\n";	
		
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}
	else
		return true;
}

function chk_reminder_frm(frmname)
{
	var msg="", dc;
	
	dc=eval("document."+frmname);
	
	if(dc.name.value.length==0)
		msg+="Please enter Your Name!\n";

	if(dc.email.value.length==0)
		msg+="Please enter your Email!\n";
		
	if(dc.title.value.length==0)
		msg+="Please enter title for your reminder!\n";
	
	/*for(i=0;i<dc.elements.length;i++)
	{
		if(dc.elements[i].name.substr(0,7)=="partner")
			alert(dc.elements[i].name+":"+dc.elements[i].value);
	}*/
	
	if(dc.partner_reminder[0].checked)	
	{
	
		if(dc.partner_name.value.length==0)
			msg+="Please enter Your Partner's name!\n";

		if(dc.partner_email.value.length==0)
			msg+="Please enter Your Partner's email!\n";
			
		if(dc.partner_title.value.length==0)
			msg+="Please enter title for your partner reminder!\n";
	}
	
	if(msg.length > 0)
	{
	
		alert(msg);
		return false;
	}		
	else
		return true;
		
}

//270309
function set_newsletter_id(obj,frm){



if(obj.checked){



	frm.value += obj.value + ",";



}else{



	arr_str = frm.value;



	arr = arr_str.split(",");



	str = "";



	for(i=0;i<arr.length;i++){



		if(arr[i] != obj.value){



			if(arr[i].length > 0){



				str = str + arr[i] + ",";



			}



		}



	}







	frm.value = "," + str;



}



}

//250509
//flex_header.php - used for userside article cat(flex) selection
function flex_search_script(val) {
  
	if(val==1){
	
		document.flex_search.submit_action.value = "search";
		document.flex_search.submit();
	
	
	}else{
		document.flex_search.contains_key1.value = "";
		document.flex_search.contains_list.value = "0";
		//document.flex_search.displaystatus.value = "";
		document.flex_search.flex_order_by.value = "";
		document.flex_search.submit();
	
	}

}

//070709
function chk_banner_business(obj)
{
	
	var msg = "";
	
	if(obj.business_name.value.length == 0)
		msg += "Please enter Business Name!\n";		
		
	if(obj.email.value.length == 0)
		msg += "Please enter email!\n";

	else if(!chk_email(obj.email))
		msg += "Please enter a valid email address!\n";
	
	if(document.getElementById('country'))
	{	
	
		if(obj.country.value.length == 0)
			msg += "Please choose country!\n";
	}		
			
	if(document.getElementById('states_dd') || document.getElementById('state'))
	{		
		if(obj.states_dd.value.length == 0)
			msg += "Please choose state!\n";
	}	
		
	if(obj.zip.value.length == 0)
		msg += "Please enter Zip!\n";
	
	if(!obj.terms.checked)
		msg+="Please accept terms and conditions!\n";
		
	if(msg.length > 0)
	{
		alert(msg);
		return false;
	}	
					
	if(document.getElementById('states_dd') || document.getElementById('state'))
	{		
	  if(obj.states_dd.getAttribute("className") == "showObject") 
		setstate(dc.states_dd);
	}
	
	return true;
}