function goCountry(){
	var a = document.getElementById("countrylink") ;

	if ( a.selectedIndex != 0 ) {
		//alert(a.options[a.selectedIndex].value);
		location.href = a.options[a.selectedIndex].value;
	}
}

function goLang(){
	var clink = new Array;
	var a = document.getElementById("langlink") ;
	clink[1] = '/index.php';
	
	if ( a.selectedIndex != 0 ) {
		location.href = clink[a.selectedIndex];
	}
}

function selectbox (t_id, t_value ) {
	var a = document.getElementById(t_id);
	for (i=0;i<a.length;i++) {		
		if ( t_value == a.options[i].value ) {
			a.options[i].selected = true;
			return false;
		}
	}
}

function checkbox( t_id, t_value ){
	if ( t_value != '' ) {
		document.getElementById(t_id).checked = true ;
	}
}

function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

function updatetopage(topage,frompage){
	
	//alert('here');
	
	var http = createRequestObject(); 
	var url = "/plans/updateToPage.php?toPage=" + topage;	
	url += '&fromPage=' + frompage;
	url = url + "&sid="+Math.random();
	http.open("GET",url,true);
	http.onreadystatechange = function(){if(http.readyState == 4){ //Finished loading the response
		
		var response = http.responseText;
		
		//alert(response);
		
		
	}};
	http.send(null);
}

function resizeFrame() {

var f = document.getElementById('ifq');
//alert(f.contentWindow.document.body.scrollHeight);
f.style.height = f.contentWindow.document.body.scrollHeight + 'px';
}

function submitform(t){

document.getElementById(t).submit();
}


