// JavaScript Document
function vIE(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
	
	/*===================Quick Code============================*/
	function quick_code(expected_timeline,budget,email,description)
	{
		$('Submit').value = 'please wait..';
		$('Submit').disabled = true;
		str="expected_timeline="+expected_timeline+"&budget="+budget+"&email="+email+"&description="+description;
		
		var url = 'ajax.php?do=quickQuote&'+str+'&rnd='+Math.random();
		return;
		new Ajax.Request(url,{
		 method: 'get',
		 onLoading: function(transport){
			//$('country_ajaxloader').show();
		 },
		 onSuccess: function(transport){
			
			var dr = transport.responseText;
			dr = dr.split("^");
			//alert(dr[1]);
			$('Submit').disabled = false;
			$('Submit').value = 'Submit';
			
		 },
		 onFailure: function(transport){
			 // when the request fails
			 alert('The request failed..');
		 },
		 onException: function(err){
			 // When an exception is encountered while executing the callbacks
			 alert('here Exception');
		 }
		 }); 
		
		
	
	}

/*===================================================================*/

	
	function participant_list(val)
	{
		//alert(val);return;
		
		 var action =  "parti_list";
		 
		 str="action="+action+"&trip_id="+val;
		 
		 var url = "participant_list.php?"+str;  
		 
		 
		 
		var xmlHttp;
			 try{    // Firefox, Opera 8.0+, Safari    
				xmlHttp=new XMLHttpRequest();    
			}
			catch (e){    // Internet Explorer    
				try{      
					xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");     
				}
				catch (e){
						  try{
								xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");       
						 }
						catch (e){
								alert("Your browser does not support AJAX!");  
								return false;
						}
				}
			}
			xmlHttp.onreadystatechange=function(){
				if(xmlHttp.readyState!=4){
					//document.getElementById("showResult1").innerHTML='';
					
					return false;
				}
				if(xmlHttp.readyState==4){
					   document.getElementById("participant").style.display='';
					   document.getElementById("par_list").innerHTML=xmlHttp.responseText;
				}
			 }
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);  
	
		
		
		
	}
	
	
	function select_price(value) {
	
	//alert(value);return;
		 
		 var action =  "price";
		 
		 str="action="+action+"&evt_id="+value;
		 var url = "check_price.php?"+str;  
		 
		 
		 
		var xmlHttp;
			 try{    // Firefox, Opera 8.0+, Safari    
				xmlHttp=new XMLHttpRequest();    
			}
			catch (e){    // Internet Explorer    
				try{      
					xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");     
				}
				catch (e){
						  try{
								xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");       
						 }
						catch (e){
								alert("Your browser does not support AJAX!");  
								return false;
						}
				}
			}
			xmlHttp.onreadystatechange=function(){
				if(xmlHttp.readyState!=4){
					document.getElementById("showResult").innerHTML='';
					document.getElementById("bb").innerHTML='0';
					return false;
				}
				if(xmlHttp.readyState==4){
						document.getElementById("showResult").innerHTML=xmlHttp.responseText;
						document.getElementById("bb").innerHTML=xmlHttp.responseText;
					//alert(xmlHttp.responseText);
				}
			 }
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);  
	
	}
	
	
	
	
	function dispPortfolio(id)	{
		
		var url = 'ajax.php?do=dispPortfolio&pid='+id+'&rnd='+Math.random();
		
		new Ajax.Request(url,{
		 method: 'get',
		 onLoading: function(transport){
			//$('country_ajaxloader').show();
		 },
		 onSuccess: function(transport){
			
			var dr = transport.responseText;
			dr = dr.split("^");
			//alert(dr[1]);
			$("portfolioBox").innerHTML = dr[1];
			
		 },
		 onFailure: function(transport){
			 // when the request fails
			 alert('The request failed..');
		 },
		 onException: function(err){
			 // When an exception is encountered while executing the callbacks
			 alert('here Exception');
		 }
		 }); 
	
	}
	
  function dispPortfolioDiv(portfolio_id){
	
	if(window.innerHeight){
		document.getElementById('hidePortfolio_viewDiv').style.height = window.innerHeight+"px";
		document.getElementById('hidePortfolio_viewDiv').style.width = window.innerWidth+"px";	
		document.getElementById('portfolio_viewDiv').style.left=(window.innerWidth-520)/2+"px";
		document.getElementById('portfolio_viewDiv').style.top=(window.innerHeight-550)/2+"px";	
	}else if(document.documentElement.clientHeight){
		
		if(vIE() == "7" || vIE() == "8"){
			$('hidePortfolio_viewDiv').style.top = 0;
			document.getElementById('portfolio_viewDiv').style.left = (document.documentElement.clientWidth-520)/2+"px";
			document.getElementById('portfolio_viewDiv').style.top = (document.documentElement.clientHeight-550)/2;
		}else{
			
			document.getElementById('hidePortfolio_viewDiv').style.height = document.documentElement.clientHeight+"px";
			document.getElementById('hidePortfolio_viewDiv').style.width = document.documentElement.clientWidth+"px";	
			$('hidePortfolio_viewDiv').style.top = document.documentElement.scrollTop;
			$('hidePortfolio_viewDiv').style.left = document.documentElement.scrollLeft;
			document.getElementById('portfolio_viewDiv').style.left = (document.documentElement.clientWidth-520)/2+"px";
			document.getElementById('portfolio_viewDiv').style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight-550)/2+"px";
		}
	}
	$j('#hidePortfolio_viewDiv').fadeIn(10);
	$j('#portfolio_viewDiv').fadeIn(10);
	
	dispPortfolio(portfolio_id);
	
}
function hidePortfolio_viewDiv(){
	$('portfolioBox').innerHTML = '';
	$j('#portfolio_viewDiv').fadeOut(10);		
	$j('#hidePortfolio_viewDiv').fadeOut(10);	
}



