var count=0;



function XMLParser(textData) {   



	var domObject = new XMLDoc(textData, xmlError);



	var domTree = domObject.docNode;



	return domTree;



}	







function xmlError(e) {



	alert("There has been an error accessing the XML Database. The error is:\n" + e);



}	 











function showCategories(arrResult,ele){



	



   var ul = document.createElement("ul");







	 for (var i = 0; i < arrResult.length; i++){



		 



		var catName=arrResult[i].getAttribute("name");


         catName = CopyToClipboard_Strip(catName);
		//catName = catName.replace("&amp;","&");



		//alert(catName);



		var CatId=arrResult[i].getAttribute("id");



		var CatDescription=arrResult[i].getAttribute("description");



		var num_category=arrResult[i].getAttribute("num_category");



		



		var aclass=(i==0) ? "current" : "";



		



			



			var li=document.createElement("li");



		       // li.className = aclass;



				



				var a  = document.createElement("a");



				     a.className=aclass;



				   a.href = "javascript:void(0);";



				   



				   a.setAttribute("id", "A_"+CatId);



				   //alert(CatId);



				  	a.onclick =function(){



							     setTab('ajax_pages/F1_upcoming_event.php?1=1','elist',this);



				   };	  



				   //alert(CatId);



				  var title_span = document.createElement("span");

				      title_span.className="cat_count";

				      title_span.appendChild(document.createTextNode("("+num_category+")"));

					



				   a.appendChild(document.createTextNode(catName));

				    a.appendChild(title_span);



			 li.appendChild(a);



			



			



			 ul.appendChild(li);



		 } //end for loop



	  



	document.getElementById(ele).appendChild(ul);



}















function showComment(arrResult,ele){



	 //alert(ele);



	 for (var i = 0; i < arrResult.length; i++){



					



			var eventID=arrResult[i].getAttribute("EventID");



			var comment=arrResult[i].getAttribute("comment");
			comment = CopyToClipboard_Strip(comment);



			var image=arrResult[i].getAttribute("image_path");



			var send_date=arrResult[i].getAttribute("send_date");



			var comment_id=arrResult[i].getAttribute("comment_id");



			var sender_name=arrResult[i].getAttribute("name");
			    sender_name = CopyToClipboard_Strip(sender_name);



			var TotalVotes=arrResult[i].getAttribute("TotalVotes");



			var TotalValues=arrResult[i].getAttribute("TotalValues");



			var sender=arrResult[i].getAttribute("userid");



			var receiver=arrResult[i].getAttribute("user_id");



			var total_comment=arrResult[i].getAttribute("total_comment");



			



			//alert("ff"+total_comment);



			//total_comment =(total_comment==undefined && total_comment=="")?0:total_comment;



			//alert(total_comment);



				document.getElementById('comment_nums').innerHTML="("+total_comment+" comments )";



				document.getElementById('comment_number').value= total_comment;



			



			var comment_main = document.createElement("div");



				comment_main.className="commentList";



				comment_main.id="E_"+comment_id;



	   



				   var f_p =document.createElement("p");



					   f_p.className="commentBy";



						 var f_text = document.createTextNode(sender_name);



						   var f_span =document.createElement("span");



							   f_span.appendChild(document.createTextNode(send_date)); 



						 f_p.appendChild(f_text);	   



						f_p.appendChild(f_span);



						



						



						  var s_p =document.createElement("p");



						  s_p.appendChild(document.createTextNode(comment));



						 



						 if(TotalVotes!=0 && TotalValues!=0 ){



							



							 var rate_per = (TotalValues/TotalVotes)*20;



						   var rating_ul =document.createElement("ul");



							 rating_ul.className="unit-rating";



							  var rating_li =document.createElement("li");



							      rating_li.className ="current-rating";



								if((rating_li.style.width=rate_per))



								  	rating_li.setAttribute('style','width:'+rate_per+'px');



								   rating_ul.appendChild(rating_li);  



								  



								  for(var k=1;k<=5;k++){



									    var rating_li_ =document.createElement("li");



										rating_ul.appendChild(rating_li_);  



								  }



								 



						 }



						 



				



						  



							  var t_p =document.createElement("p");



								 t_p.className="actions";



								if(sender==receiver){	 



					/*		var	 a_link =document.createElement("a");



								 a_link.href="javascript:void(0);";



								 a_link.onclick=function(){



									 reply();



								 };



								 a_link.appendChild(document.createTextNode("Reply"));



								 



								var 	 a_link1 =document.createElement("a");



								 a_link1.href="javascript:void(0);";



								 a_link1.onclick=function(){



									 reply();



								 };



								 a_link1.appendChild(document.createTextNode("Report Abuse"));*/



								 



								/*var 	 a_link2 =document.createElement("a");



								 a_link2.href="javascript:void(0);";



								 a_link2.id = "E_"+comment_id;



								 a_link2.onclick=function(){



									setComment('../ajax_pages/comment_accept.php?status=D',this)



								 };



								 a_link2.appendChild(document.createTextNode("Delete"));*/



								 



								 



						 /* t_p.appendChild(a_link);



						  t_p.appendChild(a_link1);*/



						/*  t_p.appendChild(a_link2);*/



					}



						  



					comment_main.appendChild(f_p);	



					comment_main.appendChild(s_p);



					if(TotalVotes!=0 && TotalValues!=0 ){



					comment_main.appendChild(rating_ul);



					}



					comment_main.appendChild(t_p);	



					document.getElementById(ele).appendChild(comment_main);



		   



		}







}











	function setComment(url,obj)



	{



		var c_id = obj.id.split("_")[1];



		var url_new = url;



		    url_new+="&commentid="+c_id;



		//	alert(url_new);



		



           if(confirm("Are you sure to detele the particular comment")){ 



		   		   		    GET_MTH_Request(url_new,obj.id,"","","","","new_comment");



		  }



		 



	



	}



	



function showNewEvents(arrResult,ele){







	



	if(arrResult.length>0){



		document.getElementById("newEvent").style.display="block";



	 for (var i = 0; i < arrResult.length; i++){



		var EventName=arrResult[i].getAttribute("name");
		   EventName = CopyToClipboard_Strip(EventName);



		var image=arrResult[i].getAttribute("image_path");



		var EventID=arrResult[i].getAttribute("id");



		var EventDescription=arrResult[i].getAttribute("description");



	    var image_valid=arrResult[i].getAttribute("image_valid");



		var EventVenue=arrResult[i].getAttribute("venue_name");
		   // EventVenue = CopyToClipboard_Strip(EventVenue);



		var EventVenueID=arrResult[i].getAttribute("venue_id");



		var EventCity=arrResult[i].getAttribute("venue_city");



		var start_date=arrResult[i].getAttribute("start_date");



		var VenueAddress = arrResult[i].getAttribute("VenueAddress");
		    VenueAddress = CopyToClipboard_Strip(VenueAddress);



		var alternative_logo = arrResult[i].getAttribute("alternative_logo");



		var page=arrResult[i].getAttribute("page");



		var total=arrResult[i].getAttribute("total");



		var Event_ID=arrResult[i].getAttribute("Event_ID");



		var CategoryID=arrResult[i].getAttribute("CategoryID");



		



		Event_ID =(Event_ID==undefined)?"":Event_ID;



		CategoryID =(CategoryID==undefined)?"":CategoryID;



		//alert(page)



		//alert(Event_ID);



		//alert(CategoryID);



		



		var main_div=document.createElement("div"); 



	        main_div.className = "eventlist";



	 



		   var first_div=document.createElement("div"); 



			   first_div.className = "eventpic";



			 



			 var a_tags=document.createElement("a");



			      a_tags.setAttribute("href","http://www.eticketbazaar.com/event/"+EventID);



			      a_tags.setAttribute("title","View Details");



			 



			// alert(image);



				var images=document.createElement("img");



				//alert(image_valid)



				if(image_valid !="" && image_valid !=undefined ){



					images.setAttribute("src",image);



				}



					else



					images.setAttribute("src",alternative_logo);



					//images.setAttribute("height","89");



					//images.setAttribute("width","96");



					images.setAttribute("alt","Event");



					images.setAttribute("title","Event");



		



			 first_div.appendChild(a_tags).appendChild(images);



	



	      var inner_div=document.createElement("div"); 



		      inner_div.className ="eventsummery";



			  



			   var atags=document.createElement("a");



			      atags.setAttribute("href","http://www.eticketbazaar.com/event/"+EventID);



			      atags.setAttribute("title","View Details");



			  



			   var h=document.createElement("h2");



	           var htext=document.createTextNode(EventName);



	            atags.appendChild(htext);	



				



			h.appendChild(atags);



			  



			  



					 var p_first =  document.createElement("p");



			  var   p_first_text =document.createTextNode(start_date+", "+VenueAddress);



			     p_first.appendChild(p_first_text);



		



		



		       var p_second =  document.createElement("p");



			    



				  var atag=document.createElement("a");



			      atag.setAttribute("href","http://www.eticketbazaar.com/event/"+EventID);



			      atag.setAttribute("title","View Details");



				   



				   var src = "http://www.eticketbazaar.com/images/detailsBttnHov.jpg";



				   var src1 = "http://www.eticketbazaar.com/images/detailsBttn.jpg";



				   var detail_image = document.createElement("img");



				       detail_image.src = "http://www.eticketbazaar.com/images/detailsBttn.jpg";



				       detail_image.setAttribute("title","View Details");



					    detail_image.setAttribute("onmouseover","this.src='" + src + "';");



						 detail_image.setAttribute("onmouseout","this.src='" + src1 + "';");



			      atag.appendChild(detail_image);



				 



		         p_second.appendChild(atag);



				 inner_div.appendChild(h);



				 inner_div.appendChild(p_first);



				 inner_div.appendChild(p_second);



				 



				  main_div.appendChild(first_div);



				    main_div.appendChild(inner_div);



                   



			document.getElementById(ele).appendChild(main_div);



			 }



			



			lastpage= Math.ceil(total/4) ; 



			



		 var page_div           =	document.createElement("div");



	     page_div.className =    "extraHolder2";



		  



		  var page_innerdiv            =	document.createElement("div");



	       page_innerdiv.className =    "ne_option";



		



		var p = document.createElement("p");



		    p.className="pre";



			



	/*	 var prev_tag=document.createElement("a");



			      prev_tag.setAttribute("href","event/"+EventID);



			      prev_tag.setAttribute("title","next");*/



				  



				  



				    var       prev_link      = document.createElement("a");   



						       	prev_link.href = "javascript:void(0)";



						



						    var       prev_link1      = document.createElement("a");   



						      



			



								prev_link.onclick =function(){



										var newpage=parseInt(page)-1;



							   //	setTab('ajax_pages/F1_upcoming_event.php?page='+newpage,'elist',this);



								GET_MTH_Request('http://www.eticketbazaar.com/ajax_pages/F1_upcoming_event.php?page='+newpage+'&mode=new&Event_id='+Event_ID+'&id='+CategoryID+'&list_value=4','recent','','','','','re');



				                };



								



							var prev_img = document.createElement("img");



							 (page>1)?prev_img.setAttribute("src","http://www.eticketbazaar.com/images/ne_previous.gif"):prev_img.setAttribute("src","http://www.eticketbazaar.com/images/ne_previous_off.gif");



								prev_img.title ="Previous";



								prev_img.alt ="Previous";



						



						



						       prev_link.appendChild(prev_img);



			 



			







		 if(page>1){



			p.appendChild(prev_link).appendChild(prev_img);



		 }else



		 p.appendChild(prev_img);



			



			



			



				var p_next = document.createElement("p");



		    p_next.className="next";



			



			



			 var       next_link1      = document.createElement("a");   



						       



								



			  var       next_link      = document.createElement("a");   



						       	next_link.href = "javascript:void(0)";



			



				next_link.onclick =function(){



										var newpage=parseInt(page)+1;



							   //	setTab('ajax_pages/F1_upcoming_event.php?page='+newpage,'elist',this);



								GET_MTH_Request('http://www.eticketbazaar.com/ajax_pages/F1_upcoming_event.php?page='+newpage+'&mode=new&Event_id='+Event_ID+'&id='+CategoryID+'&list_value=4','recent','','','','','re');



				                };



			 



			



				var next_images=document.createElement("img");



				 (page<lastpage)?next_images.setAttribute("src","http://www.eticketbazaar.com/images/ne_next.gif"):next_images.setAttribute("src","http://www.eticketbazaar.com/images/ne_next_off.gif");	



					next_images.setAttribute("alt","next");



					next_images.setAttribute("title","next");



		



		if(page<lastpage)



			p_next.appendChild(next_link).appendChild(next_images);



			else



			p_next.appendChild(next_images);



			



			page_innerdiv.appendChild(p);



					 



			



		 page_innerdiv.appendChild(p_next);







			



           page_div.appendChild(page_innerdiv);  



		 //  document.getElementById(ele).appendChild(main_div);



          document.getElementById(ele).appendChild(page_div);        



			



	}







}







function setTab(url,ele,obj){



	



	var pobj=obj.parentNode.parentNode;



	



	var child=pobj.childNodes;



	for(var i=0;i<child.length;i++){



		child[i].firstChild.className="";



	}



	var cid=obj.id.split("_")[1];



	obj.className="current";



		



	var pid=obj.id.split("_")[2];



	if(pid != undefined && pid != "")	



	GET_MTH_Request(url+"&id="+cid+"&page="+pid,ele);



	else



	GET_MTH_Request(url+"&id="+cid,ele);



	



	



}







function setPage(url,ele,obj){



	



	var cid=obj.id.split("_")[1];



	GET_MTH_Request(url+"&page="+cid,ele);



	



	



}







function showTabEvents(arrResult,ele){



//	page=(page=="" || page==undefined) ? 0 : page;







//	alert(page);		  



			  



	for (var i = 0; i < arrResult.length; i++){



		var EventName=arrResult[i].getAttribute("name").substring(0,15);



		var EventTitle=arrResult[i].getAttribute("name");
		     EventTitle = CopyToClipboard_Strip(EventTitle);



		var EventID=arrResult[i].getAttribute("id");



		var image=arrResult[i].getAttribute("image_path");



		var page=arrResult[i].getAttribute("page");



		var total=arrResult[i].getAttribute("total");



		var type=arrResult[i].getAttribute("type");



		var start_date=arrResult[i].getAttribute("start_date");



		var VenueAddress = arrResult[i].getAttribute("VenueAddress");
		      VenueAddress = CopyToClipboard_Strip(VenueAddress);



		var CategoryID=arrResult[i].getAttribute("CategoryID");



		var TotalVotes=arrResult[i].getAttribute("TotalVotes");



		var TotalValues=arrResult[i].getAttribute("TotalValues");



		var alternative_logo = arrResult[i].getAttribute("alternative_logo");



		var image_valid=arrResult[i].getAttribute("image_valid");



		



		var main_div=document.createElement("div"); 



	        main_div.className = "eventlist";



	 



		   var first_div=document.createElement("div"); 



			   first_div.className = "eventpic";



			   



			    var a_tags=document.createElement("a");



			      a_tags.setAttribute("href","event/"+EventID+"_"+CategoryID);



			      a_tags.setAttribute("title","View Details");



			 



				var images=document.createElement("img");



			



			



					if(image_valid !="" && image_valid !=undefined ){



					images.setAttribute("src",image);



					}



					else{



					images.setAttribute("src",alternative_logo);



					}



					//images.setAttribute("height","89");

//					images.setAttribute("width","96");



					images.setAttribute("alt","Event");



					images.setAttribute("title","Event");



		



			 first_div.appendChild(a_tags).appendChild(images);



	



	      var inner_div=document.createElement("div"); 



		      inner_div.className ="eventsummery";



			  



			  



			    var atags=document.createElement("a");



			      atags.setAttribute("href","event/"+EventID+"_"+CategoryID);



			      atags.setAttribute("title","View Details");



				  



			   var h=document.createElement("h2");



	           var htext=document.createTextNode(EventTitle);



	           atags.appendChild(htext);	



				



				h.appendChild(atags);



				



			  



			  



			 var p_first =  document.createElement("p");



			  var   p_first_text =document.createTextNode(start_date+", "+VenueAddress);



			     p_first.appendChild(p_first_text);



		



		//alert(TotalVotes);



		//alert(TotalValues);



		                if(TotalVotes!="" && TotalVotes!=undefined && TotalValues!="" && TotalValues!=undefined ){



							



							 var rate_per = (TotalValues/TotalVotes)*20;



						   var rating_ul =document.createElement("ul");



							 rating_ul.className="unit-rating";



							  var rating_li =document.createElement("li");



							      rating_li.className ="current-rating";



								  



								   if((rating_li.style.width=rate_per))



								  	rating_li.setAttribute('style','width:'+rate_per+'px');



								  



								  rating_ul.appendChild(rating_li);  



								  



								  for(var k=1;k<=5;k++){



									    var rating_li_ =document.createElement("li");



									/*	 var r_a =    document.createElement("a");



										  r_a.href="javascript:void(0);";



										  r_a.onclick=function(){



											  submitRating(k);



										  };



										  r_a.title= k+" star out of 5. .";



										  r_a.className="r"+k+"-unit";



										  



										  var sp = document.createElement("span");



										     sp.appendChild(document.createTextNode(k));



										  r_a.appendChild(sp); */



										//rating_li_.appendChild(r_a); 



										rating_ul.appendChild(rating_li_);  



								  }



						}



					   



		



		       var p_second =  document.createElement("p");



			       p_second.className="btn_vd";



				



				  var atag=document.createElement("a");



			      atag.setAttribute("href","event/"+EventID+"_"+CategoryID); 



			      atag.setAttribute("title","View Details");



				   var src = "images/detailsBttnHov.jpg";



				   var src1 = "images/detailsBttn.jpg";



				   var detail_image = document.createElement("img");



				       detail_image.src = "images/detailsBttn.jpg";



				       detail_image.setAttribute("title","View Details");



					    detail_image.setAttribute("onmouseover","this.src='" + src + "';");



						 detail_image.setAttribute("onmouseout","this.src='" + src1 + "';");



						



					   



			      atag.appendChild(detail_image);



				 



		         p_second.appendChild(atag);



				 inner_div.appendChild(h);



				 inner_div.appendChild(p_first);



			 if(TotalVotes!="" && TotalVotes!=undefined && TotalValues!="" && TotalValues!=undefined ){



				 inner_div.appendChild(rating_ul);



				   }



				 inner_div.appendChild(p_second);



				 



				  main_div.appendChild(first_div);



				    main_div.appendChild(inner_div);



                   



			document.getElementById(ele).appendChild(main_div);



			



		



	}







	lastpage= Math.ceil(total/6) ; 







	



    var page_div           =	document.createElement("div");



	    page_div.className =    "extraHolder";



		  



		   var page_innerdiv            =	document.createElement("div");



	           page_innerdiv.className =    "pagination";



			   



			   



	



				



	



	



	



	



				 



				  var page_ul = document.createElement("ul");



				      first = document.createElement("li");     



					  previous = document.createElement("li");



					  



					  



					  //First link



					  var       first_link      = document.createElement("a");   



						        first_link.href = "javascript:void(0)";



								first_link.id   = "N_"+CategoryID;					



			



								first_link.onclick =function(){



									



							   	setTab('ajax_pages/F1_upcoming_event.php?page=1','elist',this);



				                };



							var first_img = document.createElement("img");



							    first_img.src ="images/pagination/first.gif";



								first_img.title ="First";



								first_img.alt ="First";



						



						



						       first_link.appendChild(first_img);



							   first.appendChild(first_link);



					  



					  //previous link



					  var       prev_link      = document.createElement("a");   



						       	prev_link.href = "javascript:void(0)";



								prev_link.id   = "N_"+CategoryID;					



			



								prev_link.onclick =function(){



										var newpage=parseInt(page)-1;



							   	setTab('ajax_pages/F1_upcoming_event.php?page='+newpage,'elist',this);



				                };



							var prev_img = document.createElement("img");



							    prev_img.src ="images/pagination/previous.gif";



								prev_img.title ="Previous";



								prev_img.alt ="Previous";



						



						



						       prev_link.appendChild(prev_img);



							   previous.appendChild(prev_link);



							   



					 



			



							   



					



					



					  if(page>1){



					 document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(first);	  



					  document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(previous);	



					 	



					  }



				    



				



				      



						 Last = document.createElement("li");   



				  



				  



				  for(var j=1;j<=lastpage;j++){



					var 	paging_ul = document.createElement("li");   



						 var    a_link      = document.createElement("a"); 



						  var page_class=(j==page) ? "current" : "normal";



						 



							  a_link.className = page_class; 



						    	a_link.href = "javascript:void(0)";



								a_link.id   = "C_"+CategoryID+"_"+j;



								a_link.onclick =function(){



							     setTab('ajax_pages/F1_upcoming_event.php?1=1&page','elist',this);



				                };



								



						 var text =document.createTextNode(j);



						       a_link.appendChild(text);



						  paging_ul.appendChild(a_link); 



						  page_ul.appendChild(paging_ul);  



	                      page_innerdiv.appendChild(page_ul);



	                      page_div.appendChild(page_innerdiv);  



	                      document.getElementById(ele).appendChild(page_div);



	                }



	   



	        



			 //last link



			   



					 var  last_link = document.createElement("li");



					  



					  var      last_link      = document.createElement("a");   



						       	last_link.href = "javascript:void(0)";



								last_link.id   = "N_"+CategoryID;



								last_link.onclick =function(){



							     



				setTab('ajax_pages/F1_upcoming_event.php?page='+lastpage,'elist',this);



				                };



							var last_img = document.createElement("img");



							    last_img.src ="images/pagination/last.gif";



								last_img.title ="Last";



								last_img.alt ="Last";



						



						



						       last_link.appendChild(last_img);



							   Last.appendChild(last_link);



	   



	   



	   		 //next link



					 var  next = document.createElement("li");



					  



					  var      next_link      = document.createElement("a");   



						       	next_link.href = "javascript:void(0)";



								next_link.id   = "N_"+CategoryID;



								next_link.onclick =function(){



							     	var newpage=parseInt(page)+1;



				setTab('ajax_pages/F1_upcoming_event.php?page='+newpage,'elist',this);



				                };



							var next_img = document.createElement("img");



							    next_img.src ="images/pagination/next.gif";



								next_img.title ="Next";



								next_img.alt ="Next";



						



						



						       next_link.appendChild(next_img);



							   next.appendChild(next_link);



                



	 if(page<lastpage){



		 document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(next);	



		  document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(Last);	



	 }



		  







	







}











function showrelatedkeys(arrResult,ele)



{



	



  var str ="";



  for (var i = 0; i < arrResult.length; i++){



			var keywordname=arrResult[i].getAttribute("name");



			var keywordid=arrResult[i].getAttribute("id");



		    var EventID =arrResult[i].getAttribute("EventID");



	



	str += "<input type='checkbox' name='checkbox' id='"+keywordid+"' onclick=\"updateChk('ajax_pages/ajx_sv_assignkeycat.php?EventID="+EventID+"',this)\" >"+keywordname;



      	 



		  



		



	 }



	 	document.getElementById(ele).innerHTML=str;



}



function showAllEvents(arrResult,ele){



	



	



	// page=(page=="" || page==undefined) ? 0 : page;	



	



if(count==0){







	var p_modify = document.createElement("p");

	var label_modify = document.createElement("span");

	    label_modify.appendChild(document.createTextNode("sort"));  





var select_ = document.createElement("select");



    select_.setAttribute("id","SEL");



	



	 var   option =document.createElement("option");



	       option.value="";



		   option.id="0";



		   option.appendChild(document.createTextNode("--select--"));



		   



	 var   option1 =document.createElement("option");



	       option1.value="EventName";



		    option1.id="EventName";



			//option1.setAttribute("selected","selected");



		   option1.appendChild(document.createTextNode("EventName"));



		   



	 var   option2 =document.createElement("option");



	       option2.value="EventStartDateTime";



		  option2.id="EventStartDateTime";



		   option2.appendChild(document.createTextNode("Event Date"));	   



		   



	select_.appendChild(option);



	select_.appendChild(option1);



	select_.appendChild(option2);



	//filter_div.appendChild(select_);

	

	p_modify.appendChild(label_modify);

	p_modify.appendChild(select_);



document.getElementById("filter").appendChild(p_modify);

	

	

	

	

//free vs paid



var p_modify1 = document.createElement("p");

var label_modify1 = document.createElement("span");

	    label_modify1.appendChild(document.createTextNode("Type"));  

			 



var select_type = document.createElement("select");



    select_type.setAttribute("id","Type");



	



	 var   option_type =document.createElement("option");



	       option_type.value="0";



		   option_type.id="0";



		   option_type.appendChild(document.createTextNode("--Select--"));



		   



	 var   option1_type =document.createElement("option");



	       option1_type.value="paid";



		    option1_type.id="paid";



			//option1.setAttribute("selected","selected");



		   option1_type.appendChild(document.createTextNode("Paid"));



		   



	 var   option2_type =document.createElement("option");



	       option2_type.value="free";



		  option2_type.id="free";



		   option2_type.appendChild(document.createTextNode("Free"));	   



		   



	select_type.appendChild(option_type);



	select_type.appendChild(option1_type);



	select_type.appendChild(option2_type);



	p_modify1.appendChild(label_modify1);

	p_modify1.appendChild(select_type);

	document.getElementById("filter").appendChild(p_modify1);

	

//date type



	// var   date_div =document.createElement("div");

//

	       //  date_div.className="filter";



		var p_modify2 = document.createElement("p");	

		var label_modify2 = document.createElement("span");

	    label_modify2.appendChild(document.createTextNode("Date"));



var select_date = document.createElement("select");



    select_date.setAttribute("id","DATES");



	



	 var   option_date =document.createElement("option");



	       option_date.value="0";



		   option_date.id="0";



		   option_date.appendChild(document.createTextNode("All Future"));



		   



	 var   option1_date =document.createElement("option");



	       option1_date.value="Today";



		    option1_date.id="Today";



		   option1_date.appendChild(document.createTextNode("Today"));



		   



	 var   option2_date =document.createElement("option");



	       option2_date.value="Tommorow";



		  option2_date.id="Tommorow";



		   option2_date.appendChild(document.createTextNode("Tommorow"));	  

		   

	

	var   option3_date =document.createElement("option");



	       option3_date.value="this week";



		  option3_date.id="this week";



		   option3_date.appendChild(document.createTextNode("this week(Fri+sun)"));	

		   

		   

		/*var   option4_date =document.createElement("option");



	       option4_date.value="next week";



		  option4_date.id="next week";



		   option4_date.appendChild(document.createTextNode("next week"));	 */   

		 

				   

		var   option5_date =document.createElement("option");



	       option5_date.value="this month";



		  option5_date.id="this month";



		   option5_date.appendChild(document.createTextNode("this month"));	   

		   

		

			var   option6_date =document.createElement("option");



	       option6_date.value="next month";



		  option6_date.id="next month";



		   option6_date.appendChild(document.createTextNode("next month"));	   



		   



	select_date.appendChild(option_date);



	select_date.appendChild(option1_date);



	select_date.appendChild(option2_date);

	

	select_date.appendChild(option3_date);

//	select_date.appendChild(option4_date);

	select_date.appendChild(option5_date);

	select_date.appendChild(option6_date);

	

	

	  



//	date_div.appendChild(select_date);



	//document.getElementById("filter").appendChild(date_div);

	

		p_modify2.appendChild(label_modify2);

		p_modify2.appendChild(select_date);

	document.getElementById("filter").appendChild(p_modify2);

	



	///for listing page

	

	

	

	var p_list = document.createElement("p");

	    p_list.setAttribute("class","listpage");

var label_list = document.createElement("span");

	    label_list.appendChild(document.createTextNode("List Page"));  

			 



var select_list = document.createElement("select");



    select_list.setAttribute("id","List");



	



	 var   option_list =document.createElement("option");



	       option_list.value="0";



		   option_list.id="0";



		   option_list.appendChild(document.createTextNode("--Select--"));



		   



	 var   option1_list =document.createElement("option");



	       option1_list.value="10";



		    option1_list.id="10";



			//option1.setAttribute("selected","selected");



		   option1_list.appendChild(document.createTextNode("10"));



		   



	 var   option2_list =document.createElement("option");



	       option2_list.value="25";



		  option2_list.id="25";



		   option2_list.appendChild(document.createTextNode("25"));	   

		   

		   

	 var   option3_list =document.createElement("option");



	       option3_list.value="50";



		  option3_list.id="50";



		   option3_list.appendChild(document.createTextNode("50"));	  

		   

		   

	 var   option4_list =document.createElement("option");



	       option4_list.value="100";



		   option4_list.id="100";



		   option4_list.appendChild(document.createTextNode("100"));	  	   



		   



	select_list.appendChild(option_list);



	select_list.appendChild(option1_list);



	select_list.appendChild(option2_list);

	

	select_list.appendChild(option3_list);



	select_list.appendChild(option4_list);



	p_list.appendChild(label_list);

	p_list.appendChild(select_list);

	document.getElementById("filter").appendChild(p_list);

	  //end o listing



 

 var clear_div = document.createElement("div");

     clear_div.className="clear";

	 document.getElementById("filter").appendChild(clear_div);



} //end if count 0.







count++;



	



	



	 if(arrResult.length>0){



		



		for (var i = 0; i < arrResult.length; i++){



			var EventTitle=arrResult[i].getAttribute("name");
			    EventTitle = CopyToClipboard_Strip(EventTitle);



			var EventID=arrResult[i].getAttribute("id");



			var EventDescription=arrResult[i].getAttribute("description");



			var EventStartTime=arrResult[i].getAttribute("start_time");



			var EventVenue=arrResult[i].getAttribute("venue_name");



			var EventVenueID=arrResult[i].getAttribute("venue_id");



			var EventCity=arrResult[i].getAttribute("city_name");



			var image=arrResult[i].getAttribute("image_path");



			var VenueAddress=arrResult[i].getAttribute("VenueAddress");
			     VenueAddress = CopyToClipboard_Strip(VenueAddress);



			



			var page=arrResult[i].getAttribute("page");



			var total=arrResult[i].getAttribute("total");



			var EventStartDate=arrResult[i].getAttribute("start_date");



			var ticket = arrResult[i].getAttribute("ticket");



			var skey = arrResult[i].getAttribute("searchKey");



			var stype = arrResult[i].getAttribute("searchType");



			var urlfriendly = arrResult[i].getAttribute("URLfriendly");



			var TotalVotes=arrResult[i].getAttribute("TotalVotes");



		    var TotalValues=arrResult[i].getAttribute("TotalValues");



			var alternative_logo = arrResult[i].getAttribute("alternative_logo");



		    var image_valid=arrResult[i].getAttribute("image_valid");



			var mode =  arrResult[i].getAttribute("mode");



			var sortk =  arrResult[i].getAttribute("sort");

			

			var eventtype =  arrResult[i].getAttribute("type");

			

			var date_selected =  arrResult[i].getAttribute("date_selected");

			

			var limit =  arrResult[i].getAttribute("limit");

			

			



			//alert(date_selected);



			



           	skey =	(skey==undefined)?"":skey;



			urlfriendly =	(urlfriendly==undefined)?"":urlfriendly;



			mode =	(mode==undefined)?"":mode;



			sortk =	(sortk==undefined)?"":sortk;

			

			eventtype =	(eventtype==undefined)?"":eventtype;

			

			date_selected =	(date_selected==undefined)?"":date_selected;

			

			limit =	(limit==undefined)?"":limit;



			



	//alert(date_selected);



			



				var main_div=document.createElement("div"); 



	        main_div.className = "eventlist_sh";



	 



		   var first_div=document.createElement("div"); 



			   first_div.className = "eventpic";



			   



			    var a_tags=document.createElement("a");



			      a_tags.setAttribute("href","event/"+EventID);



			      a_tags.setAttribute("title","View Details");



			 



				var images=document.createElement("img");



					if(image_valid !="" && image_valid !=undefined ){



					images.setAttribute("src",image);



					}



					else{



					images.setAttribute("src",alternative_logo);



					}



					//images.setAttribute("height","89");



					//images.setAttribute("width","96");



					images.setAttribute("alt","Event");



					images.setAttribute("title","Event");



		



			 first_div.appendChild(a_tags).appendChild(images);



	



	      var inner_div=document.createElement("div"); 



		      inner_div.className ="eventsummery";



			  



			   var atags=document.createElement("a");



			      atags.setAttribute("href","event/"+EventID);



			      atags.setAttribute("title","View Details");



			  



			   var h=document.createElement("h2");



	           var htext=document.createTextNode(EventTitle);



	            atags.appendChild(htext);	



				



				



			  h.appendChild(atags);



			  



			  



			  //		var p_desc1 =document.createElement("p");



		//  var   p_desc =document.createTextNode(EventDescription);



		//	 p_desc1.appendChild(p_desc);



			



				 



				 	 var p_first =  document.createElement("p");



			  var   p_first_text =document.createTextNode(EventStartDate+", "+VenueAddress);



			     p_first.appendChild(p_first_text);



				 



				 



				   if(TotalVotes!="" && TotalVotes!=undefined && TotalValues!="" && TotalValues!=undefined ){



							



							 var rate_per = (TotalValues/TotalVotes)*20;



						   var rating_ul =document.createElement("ul");



							 rating_ul.className="unit-rating";



							  var rating_li =document.createElement("li");



							      rating_li.className ="current-rating";



								if((rating_li.style.width=rate_per))



								  	rating_li.setAttribute('style','width:'+rate_per+'px');



								   rating_ul.appendChild(rating_li);  



								  



								  for(var k=1;k<=5;k++){



									    var rating_li_ =document.createElement("li");



										/* var r_a =    document.createElement("a");



										  r_a.href="javascript:void(0);";



										  r_a.onclick=function(){



											  submitRating(k);



										  };



										  r_a.title= k+" star out of 5. .";



										  r_a.className="r"+k+"-unit";*/



										  



										 



										rating_ul.appendChild(rating_li_);  



								  }



						}



		



		



		       var p_second =  document.createElement("p");



			      p_second.className="btn_vd";



				  var atag=document.createElement("a");



			      atag.setAttribute("href","event/"+EventID);



			      atag.setAttribute("title","View Details");



				   



				   var src = "images/detailsBttnHov.jpg";



				   var src1 = "images/detailsBttn.jpg";



				   var detail_image = document.createElement("img");



				       detail_image.src = "images/detailsBttn.jpg";



				       detail_image.setAttribute("title","View Details");



					    detail_image.setAttribute("onmouseover","this.src='" + src + "';");



						 detail_image.setAttribute("onmouseout","this.src='" + src1 + "';");



			      atag.appendChild(detail_image);



				 



		         p_second.appendChild(atag);



				 inner_div.appendChild(h);



				// inner_div.appendChild(p_desc1);



				 



				 inner_div.appendChild(p_first);



			   if(TotalVotes!="" && TotalVotes!=undefined && TotalValues!="" && TotalValues!=undefined ){



			    inner_div.appendChild(rating_ul);



				   }



				 inner_div.appendChild(p_second);



				 



				  main_div.appendChild(first_div);



				    main_div.appendChild(inner_div);



                   



			document.getElementById(ele).appendChild(main_div);



			



		



	}



	



			



		



		lastpage= Math.ceil(total/limit) ; 



		//alert(date_selected);



		document.getElementById('SEL').onchange=function(){



		GET_MTH_Request('ajax_pages/F1_upcoming_event.php?sort='+this.value+'&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+"&type="+eventtype+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart');



	}

	

	document.getElementById('Type').onchange=function(){



		GET_MTH_Request('ajax_pages/F1_upcoming_event.php?type='+this.value+'&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+"&sort="+document.getElementById('SEL').value+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart');



	}

	

	document.getElementById('DATES').onchange=function(){



		GET_MTH_Request('ajax_pages/F1_upcoming_event.php?selected_date='+this.value+'&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+"&sort="+document.getElementById('SEL').value+"&type="+eventtype+'&list_value='+limit,'leftpart');



	}

	

	document.getElementById('List').onchange=function(){



		GET_MTH_Request('ajax_pages/F1_upcoming_event.php?list_value='+this.value+'&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+"&sort="+document.getElementById('SEL').value+"&type="+eventtype,'leftpart');



	}







	



    var page_div           =	document.createElement("div");



	    page_div.className =    "extraHolder3";



		  



		   var page_innerdiv            =	document.createElement("div");



	           page_innerdiv.className =    "pagination";



			   



			   



	



				



	



	



	



	



				 



				  var page_ul = document.createElement("ul");



				      first = document.createElement("li");     



					  previous = document.createElement("li");



					  



					  



					  //First link



					  var       first_link      = document.createElement("a");   



						        first_link.href = "javascript:void(0)";



							//	first_link.id   = "N_"+CategoryID;					



			



								first_link.onclick =function(){



							   GET_MTH_Request('ajax_pages/F1_upcoming_event.php?page=1&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+'&sort='+document.getElementById('SEL').value+"&type="+eventtype+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart');



				                };



							var first_img = document.createElement("img");



							    first_img.src ="images/pagination/first.gif";



								first_img.title ="First";



								first_img.alt ="First";



						



						



						       first_link.appendChild(first_img);



							   first.appendChild(first_link);



					  



					  //previous link



					  var       prev_link      = document.createElement("a");   



						       	prev_link.href = "javascript:void(0)";



							//	prev_link.id   = "N_"+CategoryID;					



			



								prev_link.onclick =function(){



										var newpage=parseInt(page)-1;



							   							   GET_MTH_Request('ajax_pages/F1_upcoming_event.php?page=1&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+'&sort='+document.getElementById('SEL').value+"&type="+eventtype+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart');



				                };



							var prev_img = document.createElement("img");



							    prev_img.src ="images/pagination/previous.gif";



								prev_img.title ="Previous";



								prev_img.alt ="Previous";



						



						



						       prev_link.appendChild(prev_img);



							   previous.appendChild(prev_link);



							   



					 



			



							   



					



					



					  if(page>1){



					 document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(first);	  



					  document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(previous);	



					 	



					  }



				    



				



				      



						 Last = document.createElement("li");   



				  



				  



				  for(var j=1;j<=lastpage;j++){



					var 	paging_ul = document.createElement("li");   



						 var    a_link      = document.createElement("a"); 



						  var page_class=(j==page) ? "current" : "normal";



						 



							  a_link.className = page_class; 



						    	a_link.href = "javascript:void(0)";



								a_link.id   = "C_"+j;



								a_link.onclick =function(){



							    setPage('ajax_pages/F1_upcoming_event.php?1=1&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+'&sort='+document.getElementById('SEL').value+"&type="+eventtype+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart',this);



				                };



								



						 var text =document.createTextNode(j);



						       a_link.appendChild(text);



						  paging_ul.appendChild(a_link); 



						  page_ul.appendChild(paging_ul);  



	                      page_innerdiv.appendChild(page_ul);



	                      page_div.appendChild(page_innerdiv);  



	                      document.getElementById(ele).appendChild(page_div);



	                }



	   



	        



			 //last link



			   



					 var  last_link = document.createElement("li");



					  



					  var      last_link      = document.createElement("a");   



						       	last_link.href = "javascript:void(0)";



							//	last_link.id   = "N_"+CategoryID;



								last_link.onclick =function(){



							     



				GET_MTH_Request('ajax_pages/F1_upcoming_event.php?page='+lastpage+'&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+'&sort='+document.getElementById('SEL').value+"&type="+eventtype+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart');



				                };



							var last_img = document.createElement("img");



							    last_img.src ="images/pagination/last.gif";



								last_img.title ="Last";



								last_img.alt ="Last";



						



						



						       last_link.appendChild(last_img);



							   Last.appendChild(last_link);



	   



	   



	   		 //next link



					 var  next = document.createElement("li");



					  



					  var      next_link      = document.createElement("a");   



						       	next_link.href = "javascript:void(0)";



								//next_link.id   = "N_"+CategoryID;



								next_link.onclick =function(){



							     	var newpage=parseInt(page)+1;



				GET_MTH_Request('ajax_pages/F1_upcoming_event.php?page='+newpage+'&searchKey='+skey+'&searchType='+stype+'&keyword='+urlfriendly+'&mode='+mode+'&sort='+document.getElementById('SEL').value+"&type="+eventtype+"&selected_date="+document.getElementById('DATES').value+'&list_value='+limit,'leftpart');



				                };



							var next_img = document.createElement("img");



							    next_img.src ="images/pagination/next.gif";



								next_img.title ="Next";



								next_img.alt ="Next";



						



						



						       next_link.appendChild(next_img);



							   next.appendChild(next_link);



                



	 if(page<lastpage){



		 document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(next);	



		  document.getElementById(ele).appendChild(page_div).appendChild(page_innerdiv).appendChild(page_ul).appendChild(Last);	



	 }



		 



		 



		 if(document.getElementById("EventName").value==sortk){



						//alert("hurray");



			document.getElementById("EventName").setAttribute("selected","selected");



					}



			



					if(document.getElementById("EventStartDateTime").value==sortk)



			document.getElementById("EventStartDateTime").setAttribute("selected","selected");







	 }



	 else



	  document.getElementById(ele).innerHTML="Sorry the search result not found";



	 







			



			



	



			







}







/*function showEventDetails(arrResult,ele){



	 for (var i = 0; i < arrResult.length; i++){



		var EventName=arrResult[i].getAttribute("name");



		var EventID=arrResult[i].getAttribute("id");



		var EventDescription=arrResult[i].getAttribute("description");



		var EventStartTime=arrResult[i].getAttribute("start_time");



		var EventVenue=arrResult[i].getAttribute("venue_name");



		var EventVenueID=arrResult[i].getAttribute("venue_id");



		var EventCity=arrResult[i].getAttribute("venue_city");



		var image=arrResult[i].getAttribute("image_path");



		var latitude=arrResult[i].getAttribute("latitude");



		var longitude=arrResult[i].getAttribute("longitude");



		var additionalInfo=document.createElement("div");



		additionalInfo.setAttribute("class","additionalInfo");



		



			var phototitleDiv=document.createElement("div");



			phototitleDiv.setAttribute("id","phototitle");



				var txtPhoto=document.createTextNode("Photo");



			phototitleDiv.appendChild(txtPhoto);



			var officialPhotosDiv=document.createElement("div");



			officialPhotosDiv.setAttribute("id","officialPhotos");



				var atagImg=document.createElement("a");



				atagImg.setAttribute("href","images/111");



					var imgTag=document.createElement("img");



					imgTag.setAttribute("src",image);



					imgTag.setAttribute("width",250);



				atagImg.appendChild(imgTag);	



	 		officialPhotosDiv.appendChild(atagImg);



	 additionalInfo.appendChild(phototitleDiv);



	 additionalInfo.appendChild(officialPhotosDiv);



	



		var dateDiv=document.createElement("div");



		 dateDiv.setAttribute("class","date");



			var dateTxt=document.createTextNode("2008-7-7");



		 dateDiv.appendChild(dateTxt);



		



		var timeDiv=document.createElement("div");



		 timeDiv.setAttribute("class","time");



			var timeTxt=document.createTextNode("10:30:00");



		 timeDiv.appendChild(timeTxt);



	



	additionalInfo.appendChild(dateDiv);



	additionalInfo.appendChild(timeDiv);



		var venueDiv=document.createElement("div");



		



		venueDiv.setAttribute("class","venue");



			var fnspan=document.createElement("span");



				var avenue=document.createElement("a");



				avenue.setAttribute("href","javascript:showMap('"+latitude+"','"+longitude+"')");



					var venueTxt=document.createTextNode(EventCity+","+EventVenue);



			avenue.appendChild(venueTxt);	



			fnspan.appendChild(avenue);



		venueDiv.appendChild(fnspan);



			var br1=document.createElement("br");



		



		venueDiv.appendChild(br1);



			var addressDiv=document.createElement("div");



				addressDiv.setAttribute("class","address");



					var spanAddress=document.createElement("span");



					spanAddress.setAttribute("class","street");



						var streetTxt=document.createTextNode("street name here");



					spanAddress.appendChild(streetTxt);



		venueDiv.appendChild(spanAddress);	



	



	additionalInfo.appendChild(venueDiv);	



	



		var catDiv=document.createElement("div");



		catDiv.setAttribute("class","small");



			var txtCat=document.createTextNode("Category");



		catDiv.appendChild(txtCat);



			var spanCat=document.createElement("span");



			spanCat.setAttribute("id","category");



				var catLabel=document.createTextNode("category1,category2");



			spanCat.appendChild(catLabel);



		



	additionalInfo.appendChild(catDiv);	



		var descDiv=document.createElement("div");



		descDiv.setAttribute("class","description");



			var txtdesc=document.createTextNode(EventDescription);



		descDiv.appendChild(txtdesc);



	additionalInfo.appendChild(descDiv);



	document.getElementById(ele).appendChild(additionalInfo);



	}



	



}*/







/*function showLocations(arrResult,ele){



	 var h3=document.createElement("h3");



	 	var h3text=document.createTextNode("Popular Places");



	 h3.appendChild(h3text);	



	 var p=document.createElement("p");



	 for (var i = 0; i < arrResult.length; i++){



		var CountryName=arrResult[i].getAttribute("name");



		var CountryID=arrResult[i].getAttribute("id");



		var CountryCode=arrResult[i].getAttribute("code");



		var span=document.createElement("span");



			span.setAttribute("class","place");



			var a=document.createElement("a");



				var txt=document.createTextNode(CountryName);



			a.appendChild(txt);



			a.setAttribute("href","place/"+CountryID);



		span.appendChild(a);



		p.appendChild(span);



	 }



	document.getElementById(ele).appendChild(h3);



	document.getElementById(ele).appendChild(p);



}*/







/*function showUsers(arrResult,ele){



	 var h3=document.createElement("h3");



	 	var h3text=document.createTextNode("List of users");



	 h3.appendChild(h3text);	



	 var ul=document.createElement("ul");



	 for (var i = 0; i < arrResult.length; i++){



		var Name=arrResult[i].getAttribute("name");



		var ID=arrResult[i].getAttribute("id");



		var UserName=arrResult[i].getAttribute("username");



		var image=arrResult[i].getAttribute("photourl");



		var li=document.createElement("li");



			



			var imagespan=document.createElement("span");



			imagespan.setAttribute("class","userimage");



				var a=document.createElement("a");



					var img=document.createElement("img");



					img.setAttribute("src",image);



					img.setAttribute("height",50);



					img.setAttribute("width",50);



					img.setAttribute("border",0);



				a.appendChild(img);



			a.setAttribute("href","user/"+ID);



			imagespan.appendChild(a)



			



			



			var usernamespan=document.createElement("span");



			usernamespan.setAttribute("class","username");



				var a=document.createElement("a");



					var txt=document.createTextNode(UserName);



				a.appendChild(txt);



			a.setAttribute("href","user/"+ID);



			usernamespan.appendChild(a);



			



			var userspan=document.createElement("span");



			userspan.setAttribute("class","username");



				var a=document.createElement("a");



					var txt=document.createTextNode(Name);



				a.appendChild(txt);



			a.setAttribute("href","user/"+ID);



			userspan.appendChild(a);



		



		li.appendChild(imagespan);



		li.appendChild(usernamespan);



		li.appendChild(userspan);



		ul.appendChild(li);



	 }



	document.getElementById(ele).appendChild(h3);



	document.getElementById(ele).appendChild(ul);	



}



*/