//Code for call hotel detail page
// This function called ajax as well as check table td class and change it accordingly like for tabbling details
function loadingAjaxPage(block,targetObj,tableName,targetLink,siteUrl,flname)
{
block_code = document.getElementById(block);
block_code.innerHTML ="
";
var table = document.getElementById(tableName);
var cells = table.getElementsByTagName("td");
for (var i = 0; i < cells.length; i++)
{
// grab the data
if(cells[i].id ==targetObj )
cells[i].className="active_tab" //select all tabs
else
cells[i].className="tab_links" //deselect all tabs
}
ajaxFunction(block_code,targetLink,flname);
}
// This function called ajax without check table td class like for tabbling details
function loadingCommonAjaxPage(block,targetObj,targetLink,siteUrl,flname)
{
block_code = document.getElementById(block);
block_code.innerHTML ="";
ajaxFunction(block_code,targetLink,flname);
}
function is_blank(value,divname,msg)
{
//var frm_hid_fld_name=eval(hid_fld_name);
val = value;
val = val.replace(/^\s+/, '');
val.replace(/\s+$/, '');
if(val.length == 0 )
{
document.getElementById(divname).innerHTML="Please enter "+msg;
document.getElementById(divname).style.display="block";
}
else
{
/////document.getElementById(divname).innerHTML= "
";
document.getElementById(divname).style.display="none";
}
}
function check_dropdown(value,divname,msg)
{
//var frm_hid_fld_name=eval(hid_fld_name);
val = value;
if(val == 0 )
{
document.getElementById(divname).innerHTML="Please enter "+msg;
document.getElementById(divname).style.display="block";
}
else
{
/////document.getElementById(divname).innerHTML= "
";
document.getElementById(divname).style.display="none";
}
}
function check_email(value,divname,msg)
{
//var frm_hid_fld_name=eval(hid_fld_name);
val = value;
if(val == 0 )
{
document.getElementById(divname).innerHTML="Please enter "+msg;
document.getElementById(divname).style.display="block";
}
else
{
/////document.getElementById(divname).innerHTML= "
";
document.getElementById(divname).style.display="none";
}
}
//Code For Check EmailAddress
function chkEmail(value,divname,siteUrl)
{
var url=siteUrl+"/email_validations.php";
url=url+"?val="+value;
divname = document.getElementById(divname);
ajaxFunction(divname,url);
}
//End Code For Check EmailAddress
/*
mycenteralpopwinVHS(fname,width,height) //Checks if the String is Blank
*/
function mycenteralpopwinVHS(fname,width,height)
{
var file
var sWidth = 200
var sHeight = 200
if(width.length > 0){
sWidth = width;
}
else{
width =100;
}
if(height.length > 0){
sHeight = height;
}
else{
height =100;
}
file = fname
var wintop = window.screen.availHeight;
var winleft = window.screen.availWidth;
wintop = (wintop/2) -(height/2)
winleft = (winleft/2) -(width/2)
if ( sWidth > window.screen.availWidth )
{ sWidth = window.screen.availWidth; }
if (sHeight > window.screen.availHeight )
{ sHeight = window.screen.availHeight; }
if ( parseInt(sWidth) < width )
{ sWidth = width; }
if ( parseInt(sHeight) < height )
{ sHeight = height; }
if ( navigator.appName == "Microsoft Internet Explorer" )
{
window.open(file, "_blank", "status=no, scrollbars=yes, toolbar=no, resizable=yes, location=no , menubar=no, top=" + wintop + ", left= "+ winleft +", height=" + sHeight + ", width=" + sWidth);
}
if ( navigator.appName == "Netscape" )
{
window.open(file,"_blank"," scrollbars=yes,resizable=yes,top=" + wintop + ", left= "+ winleft +",alwaysRaised,dependant,innerheight=" + sHeight + ",innerwidth=" + sWidth);
}
}
// Ajax Function ----------------------------------------------------->
function ajaxFunction(c,url,flname) {
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
// do nothing
}
}
}
var parameters = [];
if (!http_request) {
c.innerHTML = 'Unfortunatelly you browser doesn\'t support this feature.';
}
http_request.onreadystatechange = function()
{
if (http_request.readyState == 4) {
if (http_request.status == 200) {
c.innerHTML = http_request.responseText;
} else {
c.innerHTML = 'There was a problem with the request.(Code: ' + http_request.status + ')';
}
}
}
if((flname=="inc_home_getting_listing.php") || (flname=="inc_home_bibliophil_listing.php"))
{
url=url+"?pg=ajax";
http_request.open('GET', url, true);
}
else
{ //alert("hello " + url);
//url = encodeURI(url);
http_request.open('GET', url, true);
}
//http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//http_request.setRequestHeader("Connection", "close");
http_request.send(null);
}
function verifyNumeric(which)
{
var oldvalue = [''];
if (isNaN(which.value))
{
if (oldvalue[which])
{
which.value = oldvalue[which];
}
else
{
which.value = '';
oldvalue[which] = '';
}
}
else
{
oldvalue[which] = which.value;
}
}