// JavaScript Document

function createRequestObject() {

    var ro;

    var browser = navigator.appName;

    if(browser == "Microsoft Internet Explorer"){

        ro = new ActiveXObject("Microsoft.XMLHTTP");

    }else{

        ro = new XMLHttpRequest();

    }

    return ro;

}



var http = createRequestObject();

function sndReq(action) {

    http.open('get', action);

    http.onreadystatechange = handleResponse;

    http.send(null);

}

function handleResponse() {

    if(http.readyState == 4){

		//alert(http.responseText);

		document.getElementById('txtHint1').innerHTML = http.responseText;

    }

}

function chg_currency(str,str2) {

	
	if(str)
	{
		document.getElementById('tab_hid').style.display='none';
	}
	var val = "currency_convert.php?sid=" + Math.random() + "&currency=" + str+"&model_id="+str2;

	sndReq(val);

	return false;

}















function openWindow(url) {

  window.open(url,'popupWindow','resizable=no,scrollbars=yes,toolbar=no,status=no,height=650,width=720');

}

function expandOrClose(arrow_id, list_num, list_name)  {

	var a = document.getElementById(arrow_id);

	if(a.name=='d') { 

		a.src='arrowRight.gif';

		a.name='r';

		hideSearchTypes(list_num,list_name);

	}

	else {

		a.src='arrowDown.gif';

		a.name='d';

		showSearchTypes(list_num,list_name);

	}

	return false;

}

function hideSearchTypes (i,j) { 

	var theDiv = document.getElementById(j).getElementsByTagName('li');

	for(var d = 1; d < theDiv.length; d++) {

		var theID = 'res-'+i+'-'+d;

		Effect.DropOut(theID);

	}

}	

function showSearchTypes (i,j) { 

	var theDiv = document.getElementById(j).getElementsByTagName('li');

	for(var d = 1; d < theDiv.length; d++) {

		var theID = 'res-'+i+'-'+d;

		

		Effect.Appear(theID);

	}

}




