	//var url="http://server/OQTV2_new/index.php/";
	//var url="http://desing/OQTV2_new/index.php/";
	var url="http://www.onlinequestiontool.com/";  
	var xmlhttp
	function GetXmlHttpObject()
	{
		if (window.XMLHttpRequest){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	
	if (window.ActiveXObject){
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
		return null;
	}

function search_surveys()
{
	//alert(document.getElementById("keyword").value)
	keyword=document.getElementById("keyword").value
	//alert(url+'library/search/'+keyword);
	window.location.href=url+'index.php/library/search/'+keyword
	
}

function search_library()
{
	//alert(document.getElementById("keyword").value)
	keyword=document.getElementById("keyword").value
	
	window.location.href=url+'pages/search_library/'+keyword
	
}

function validate() {
if(document.getElementById("hidden_title").value=='') {
document.getElementById("review_titleerror").style.display='block';
return false;
	}
	else {
	document.getElementById("review_titleerror").style.display='none';
	}
 if(document.getElementById("hidden_text").value=='') {
document.getElementById("reviewerror").style.display='block';
return false;
//alert("review")
	} else {
	document.getElementById("reviewerror").style.display='none';
	}
	<!--else if (document.getElementById("review_appraisal")[0].checked == false &&  document.getElementById("review_appraisal")[1].checked == false  ) { 
	//alert ( "Please choose your Gender: Male or Female" ); 
	//return false; 
	//} -->
	 if(document.getElementById("rating").value=='') {
document.getElementById("ratingerror").style.display='block';
return false;
//alert("review")
	} else {
	document.getElementById("ratingerror").style.display='none';
	}
	
	var review_title=escape(document.getElementById("review_title").value)
	var review=escape(document.getElementById("review").value)
	var rating=escape(document.getElementById("rating").value)
	
	
	 if(review_title!='' && review!='') 
	 {
	   //document.MyReview.submit();
	   var survey_id=document.getElementById("survey_id").value
	   
		//alert(catid) 
		var file_url=url+'index.php/library/writereview'		
		//alert(file_url);
		//alert(url+"library/writereview/"+survey_id+"/"+review_title+"/"+review+"/"+rating)
		
		window.location.href=url+escape("index.php/library/writereview/"+survey_id+"/"+review_title+"/"+review+"/"+rating)
		
		//var parameters="survey_id="+survey_id+"&review_title="+review_title+"&review="+review+"&rating="+rating
	   /*alert(parameters);
		xmlHttp.onreadystatechange=display_change
		xmlHttp.open("POST",file_url,true)
    	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	    xmlHttp.setRequestHeader("Content-length", parameters.length);
    	xmlHttp.setRequestHeader("Connection", "close");
	    xmlHttp.send(parameters);	*/
	}
}


function display_change(){ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
			if(xmlHttp.responseText!=""){
				alert(xmlHttp.responseText);
				var survey_id=document.getElementById("survey_id").value
				window.location.href=url+"index.php/library/surveydetail/"+survey_id
				//document.getElementById("subcat").innerHTML=xmlHttp.responseText;	   
			}
		}
	 
	}

function set_selected_template(id)
{
	document.getElementById("template_id").value=id
	for(var i=2;i<=11;i++)
	{
		imgname="img"+i;
		if(parseInt(id)==parseInt(i)) 
		{
			if(parseInt(id)==10)
			{
				document.getElementById("img"+i).className="frmbutttonsAct"
			}
			else
			{
				document.getElementById("img"+i).className="imgSelected"
			}
		}else
		{
			document.getElementById("img"+i).className=""
		}
	}
}

function Set_Action(type_id,survey_id,action_id) {
       
	  
		if (type_id==1) {
			if (action_id==8) {
				var file_url=url+'export_data/index/'+survey_id
			} else if (action_id==7){
				//var file_url=url+'import/index/'+survey_id
				var file_url=url+'dashboard/invitesurvey/'+survey_id
				
			} else if (action_id==6){
				var file_url=url+'dashboard/survey_clear/'+survey_id
			} else if (action_id==4){
				var file_url=url+'dashboard/launchsurvey/'+survey_id
			} else if (action_id==2){
				var file_url=url+'dashboard/editsurvey/'+survey_id
			} else if (action_id==5){
				ans=confirm('Are you sure wants to delete this survey?');	
		         if(ans==true){
				var file_url=url+'dashboard/deletesurvey/'+survey_id
				 }
				 else {
					 return false;
				 }
			} else if (action_id==1){
				//var file_url=url+'surveyresults/index/'+survey_id
				var file_url=url+'dashboard/gotoresults/'+survey_id
			} else if (action_id==3){
				var file_url=url+'dashboard/copy_survey/'+survey_id
			} else if (action_id==9){
				var file_url=url+'dashboard/survey_payments/'+survey_id
			} else {
				file_url="";
			}
			//alert(file_url)
			if (file_url!=""){
				document.location.href=file_url
			}	
		}		
	}

//mypopup
function mypopup(temp_id){
	//alert("id"+temp_id)
		var Background=document.frm_addsurv.colorvalue_1.value
		Background = Background.replace("#", "hash");

		var Background_contant=document.frm_addsurv.colorvalue_2.value
		Background_contant = Background_contant.replace("#", "hash");

		var Text_color=document.frm_addsurv.colorvalue_3.value
		Text_color = Text_color.replace("#", "hash");

		var Border_color=document.frm_addsurv.colorvalue_4.value
		Border_color = Border_color.replace("#", "hash");


		if (document.frm_addsurv.template_id[5].checked==true){
			var tpl_apply=1
		} else {
			var tpl_apply=0
		}
		var temp = temp_id
var URL
URL=url+"dashboard/survey_view/"+Background+"/"+Background_contant+"/"+Text_color+"/"+Border_color+"/"+tpl_apply+"/"+temp+""
mywindow = window.open (URL,"mywindow","location=0,status=0,scrollbars=1");
} 
//get library category
function get_lib_cat(status){
	
	 if(status==1){
		 document.getElementById("lib_cat").style.display='block'
	 } else {
		 document.getElementById("lib_cat").style.display='none'
	 }
}

