/**
 * @author Administrateur
 * @version 22 Jan. 2010
 */

var defaultparam = 'user=705&curr=2&ilng=1';
var url_cresa = 'http://booking.locations-voitures-tunisie.com/cr.resa';
function sReq(m, p, v)
{
var obj = null;
if (window.XMLHttpRequest) 
obj = new XMLHttpRequest();
else 
if (window.ActiveXObject) 
obj = new ActiveXObject("Microsoft.XMLHTTP");
else 
return (false);
obj.open(m, p, false);
obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
obj.send(v);
return obj;
}
function loginMember()
{
	var strMail = document.getElementById('TextBox_Login_1').value;
	var strPass = document.getElementById('Textbox_passWord_1').value;
	var blnRm =document.getElementById('rm').checked;
//Send(url_cresa, strMail, strPass, blnRm);
//	location.href = url_cresa + '/ui/crm/signin.aspx?'+ defaultparam  +'&l='+ strMail + '&p=' + strPass +'&rm=' + blnRm;
	location.href = url_cresa + '/ui/crm/Login.aspx?'+ defaultparam  +'&l='+ strMail + '&p=' + strPass +'&rm=' + blnRm;
	/*
	var url = url_cresa + '/ui/crm/signin.aspx';
	variables = defaultparam  +'&l='+ strMail + '&p=' + strPass +'&rm=' + blnRm;
xAjax = sReq('post', url, variables);
if (xAjax.readyState == 4 || xAjax.readyState == 'complete') 
location.href = xAjax.responseText + '?' + variables;
*/
}
/*
function loginMember() {
	var strMail = document.getElementById('TextBox_Login_1').value;
	var strPass = document.getElementById('Textbox_passWord_1').value;
	var blnRm = document.getElementById('rm').checked;
location.href = url_cresa + '/ui/crm/signin.aspx?'+ defaultparam  +'&l='+ strMail + '&p=' + strPass +'&rm=' + blnRm;
	//Send(url_cresa,strMail,strPass,blnRm);
}
*/

function onfocus_onblur(obj, strMsg) {
	if (obj.value == strMsg) {
obj.value = '';
return 0;
	}
if (obj.value == '') {
obj.value = strMsg;
return 0;
	}

}

function gotoRememberPassword0() {
	ShowPopup(url_cresa + '/ui/aba/Remember_MemberPassword.aspx?popup=1&'
+ defaultparam);
}

function ShowPopup(path) {
	var new_window = window
.open(
path,
'new_window',
'height=155, width=400, top=300, left=500, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=no, status=no');
	new_window.focus();
}
function gotoSubscribe() {
	location.href = url_cresa + '/ui/crm/Subscribe.aspx?' + defaultparam;

}
function gotoDisconnect() {
	location.href = url_cresa + '/ui/crm/LogOut.aspx?' + defaultparam;

}
function gotoMemberDetail() {
	location.href = url_cresa + '/ui/crm/Member_Detail.aspx?' + defaultparam;

}

function subReservation() {
	test = true;
	user = document.getElementById('user').value;
	curr = document.getElementById('curr').value;
	ilng = document.getElementById('ilng').value;
	lang = document.getElementById('lang').value;
	idcarcategory = document.getElementById('idcarcategory').value;
	idpickuprentcaragency = document.getElementById('idpickuprentcaragency').value;
	idreturnrentcaragency = document.getElementById('idreturnrentcaragency').value;
	departuredate = document.getElementById('departuredate').value;
	departuretime = document.getElementById('departuretime0').value
+ document.getElementById('departuretime1').value;
	returndate = document.getElementById('returndate').value;
	returntime = document.getElementById('returntime0').value
+ document.getElementById('returntime1').value;
	if (user && curr && ilng && idcarcategory && idpickuprentcaragency
&& idreturnrentcaragency && departuredate && departuretime
&& returndate && returntime) {
	//	url = url_cresa+"/ui/aba/CarCategory_Payment.aspx?" + defaultparam
url = "reservation_frame.php?"
+ "&lang="
+ lang
+ "&user="
+ user
+ "&curr="
+ curr
+ "&ilng="
+ ilng
+ "&idcarcategory="
+ idcarcategory
+ "&idpickuprentcaragency="
+ idpickuprentcaragency
+ "&idreturnrentcaragency="
+ idreturnrentcaragency
+ "&departuredate="
+ departuredate
+ "&departuretime="
+ departuretime
+ "&returndate="
+ returndate 
+ "&returntime=" + returntime;
window.location = url;
	} else {
return false;
	}
}

/*
 * function loginMember() { var strMail =
 * document.getElementById('TextBox_Login_1').value; var strPass =
 * document.getElementById('Textbox_passWord_1').value; var blnRm =
 * document.getElementById('rm').checked;
 * 
 * var strUrl = 'signin.php?user=705&l=' + strMail + '&p=' + strPass + '&rm=on';
 * 
 * location.href = strUrl; }
 * 
 * function onfocus_onblur(obj, strMsg) { if (obj.value == strMsg) { obj.value =
 * ''; return 0; }
 * 
 * if (obj.value == '') { obj.value = strMsg; return 0; }
 *  }
 * 
 * function gotoRememberPassword() {
 * ShowPopup('Remember_MemberPassword.php?popup=1&user=705&curr=1&ilng=1'); }
 * 
 * function ShowPopup(path) { var new_window = window .open( path, 'new_window',
 * 'height=155, width=400, top=300, left=500, toolbar=no, menubar=no,
 * location=no, resizable=yes, scrollbars=no, status=no'); new_window.focus(); }
 * 
 * function gotoSubscribe() { location.href =
 * 'Subscribe.php?user=705&curr=1&ilng=1';
 *  }
 * 
 * function gotoDisconnect() { location.href =
 * 'LogOut.php?user=705&curr=1&ilng=1';
 *  }
 * 
 * function ShowPopup(path) { var new_window = window .open( path, 'new_window',
 * 'height=155, width=400, top=300, left=500, toolbar=no, menubar=no,
 * location=no, resizable=yes, scrollbars=no, status=no'); new_window.focus(); }
 * function gotoRememberPassword() {
 * ShowPopup('Remember_MemberPassword.php?popup=1&user=705&rm=on'); }
 */


