sel_count = "europe";

function showTimeN(Del,MS){

    var timezone1 = "GMT "+Del;

    var timedate1 = new Date(MS);
    var timezone_hours1 = Number(timezone1.substring(5, 7));
    var timezone_minutes1 = Number(timezone1.substring(8, 10));
    if (timezone1.charAt(4) == "-") {
        timezone_hours1 = timezone_hours1*-1;
        timezone_minutes1 = timezone_minutes1*-1;
    }
    timedate1.setDate(timedate1.getUTCDate());
    timedate1.setHours(timedate1.getUTCHours()+timezone_hours1);
    timedate1.setMinutes(timedate1.getUTCMinutes()+timezone_minutes1);
    var hour1 = timedate1.getHours();
    var minutes1 = timedate1.getMinutes();
    var seconds1 = timedate1.getSeconds();

    var shour,smin,ssec;

    if ( hour1 < 10 ) {
        shour = "0"+hour1;
    }
    else {
        shour = hour1;
    }

    if ( minutes1 < 10 ) {
        smin = "0"+minutes1;
    }
    else {
        smin = minutes1;
    }

    if ( seconds1 < 10 ) {
        ssec = "0"+seconds1;
    }
    else {
        ssec = seconds1;
    }

    var tmp=shour+":"+smin+":"+ssec;

    document.getElementById('clockcurrenttime2').innerHTML=tmp;
    var t=setTimeout('showTimeN("'+Del+'", ' + (MS + 1000) + ')',1000);
}
/*function showTime(Del){

	var timezone1 = "GMT "+Del;

	var timedate1 = new Date();
	var timezone_hours1 = Number(timezone1.substring(5, 7));
	var timezone_minutes1 = Number(timezone1.substring(8, 10));
	if (timezone1.charAt(4) == "-") {
	  timezone_hours1 = timezone_hours1*-1;
	  timezone_minutes1 = timezone_minutes1*-1;
	}
	timedate1.setDate(timedate1.getUTCDate());
	timedate1.setHours(timedate1.getUTCHours()+timezone_hours1);
	timedate1.setMinutes(timedate1.getUTCMinutes()+timezone_minutes1);
	var hour1 = timedate1.getHours();
	var minutes1 = timedate1.getMinutes();
	var seconds1 = timedate1.getSeconds();

	var shour,smin,ssec;

	if ( hour1 < 10 ) {shour = "0"+hour1;}
	else {shour = hour1;}

	if ( minutes1 < 10 ) {smin = "0"+minutes1;}
	else {smin = minutes1;}

	if ( seconds1 < 10 ) {ssec = "0"+seconds1;}
	else {ssec = seconds1;}

	var tmp=shour+":"+smin+":"+ssec;

	document.getElementById('clockcurrenttime2').innerHTML=tmp;
 	var t=setTimeout('showTime("'+Del+'")',1000);
}*/
function openfilters(Icon) {
    var Cond = true;
    var Obj;
    var i = 0;
    if ( Icon.src.substring(Icon.src.length-8) == "plus.gif" ) { //Open All
        while ( Cond ) {
            i++;
            Obj = document.getElementById("filbody"+i);
            if ( Obj ) {
                Obj.className = "innerfilterbody blocker";
                document.getElementById("icon"+i).innerHTML = '<img src="/images/minusitem.gif" title="Open Filter" alt="Open Filter" border="0" class="tat" onclick="openfilter('+i+');" />';
            }
            else {
                Cond = false;
            }
        }
        document.getElementById("icon0").innerHTML = '<img src="/images/minus.gif" title="Close All Filters" alt="Close All Filters" border="0" class="tat" onclick="openfilters(this);" />';
    }
    else { //Close All
        while ( Cond ) {
            i++;
            Obj = document.getElementById("filbody"+i);
            if ( Obj ) {
                Obj.className = "innerfilterbody hider";
                document.getElementById("icon"+i).innerHTML = '<img src="/images/plusitem.gif" title="Open Filter" alt="Open Filter" border="0" class="tat" onclick="openfilter('+i+');" />';
            }
            else {
                Cond = false;
            }
        }
        document.getElementById("icon0").innerHTML = '<img src="/images/plus.gif" title="Open All Filters" alt="Open All Filters" border="0" class="tat" onclick="openfilters(this);" />';
    }
}
function resetfilters() {

    document.getElementById("minstarrating").options[0].selected = true;
    document.getElementById("hotels_per_pg").options[0].selected = true;
    refineSearch();
}
function openfilter(Nom) {
    var Obj = document.getElementById("filbody"+Nom);
    if ( Obj ) {
        if ( Obj.className == "innerfilterbody hider" ) {
            Obj.className = "innerfilterbody blocker";
            document.getElementById("icon"+Nom).innerHTML = '<img src="/images/minusitem.gif" title="Open Filter" alt="Open Filter" border="0" class="tat" onclick="openfilter('+Nom+');" />';
        }
        else {
            Obj.className = "innerfilterbody hider";
            document.getElementById("icon"+Nom).innerHTML = '<img src="/images/plusitem.gif" title="Open Filter" alt="Open Filter" border="0" class="tat" onclick="openfilter('+Nom+');" />';
        }
    }
}
function showsupportdet(Nom) {
    document.getElementById("supdet"+Nom).style.zIndex = 10;
}
function hidesupportdet(Nom) {
    document.getElementById("supdet"+Nom).style.zIndex = 2;
}

function changedet_tab(Nom) {

    if ( Nom == 2 ) { // Open Guest reviews
        document.getElementById("det_reviews").style.display = "block";
        document.getElementById("det_overview").style.display = "none";
		
        document.getElementById("det_reviews2").style.display = "block";
        document.getElementById("det_overview2").style.display = "none";
		
        document.getElementById("det_tab2").innerHTML = document.getElementById("det_tab2_const").innerHTML;
        document.getElementById("det_tab2").className = 'det_tab_active';
		
        document.getElementById("det_tab1").innerHTML = '<div onclick="changedet_tab(1);">'+document.getElementById("det_tab1_const").innerHTML+'</div>';
        document.getElementById("det_tab1").className = 'tat det_tab_pass';

    }
    else {
        document.getElementById("det_overview").style.display = "block";
        document.getElementById("det_reviews").style.display = "none";
		
        document.getElementById("det_overview2").style.display = "block";
        document.getElementById("det_reviews2").style.display = "none";
		
        document.getElementById("det_tab2").innerHTML = '<div onclick="changedet_tab(2);">'+document.getElementById("det_tab2_const").innerHTML+'</div>';
        document.getElementById("det_tab2").className = 'tat det_tab_pass';
		
        document.getElementById("det_tab1").innerHTML = document.getElementById("det_tab1_const").innerHTML;
        document.getElementById("det_tab1").className = 'det_tab_active';

    }
}


function ImgShw(FN, width, height, alt) {		
    var scroll = "no";
    var top=0, left=0;
		
    if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
    if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
    if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
    width = Math.min(width, screen.width-10);
    height = Math.min(height, screen.height-28);
	
    var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
		
    wnd.document.write("<html><head>"+"<"+"script type=\"text/javascript\">"+"function KeyPress()"+"{"+"if(window.event.keyCode == 27) "+"		window.close();"+"}"+"</"+"script>"+"<title>"+(alt == ""? "":alt)+"</title></head>"+"<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\">"+"<img src=\""+FN+"\" border=\"0\" alt=\""+alt+"\" />"+"</body></html>");
    wnd.document.close();
}

function setclock(val) {
    document.getElementById("clockcurrenttime").innerHTML = val;
}
function convert() {

}

function requestPostAjax(url, data, callbackFn, callbackArgs) {
    $.post(
        url,
        data,
        function(res) {
            callbackFn(res, callbackArgs);
        },
        "json");
}


function update_fullCheckInDate()
{  
    new_day = $("#cinday :selected").val();
    new_month = 1+parseInt($("#cinmonth").val());
    new_year = $("#cinyear").val();
    new_date=new_month+"/"+new_day+"/"+new_year;
    $("#fullCheckInDate").val(new_date);
}

function update_fullCheckOutDate()
{
    new_day = $("#cotday :selected").val();
    new_month = 1+parseInt($("#cotmonth").val());
    new_year = $("#cotyear").val();
    new_date=new_month+"/"+new_day+"/"+new_year;
    $("#fullCheckOutDate").val(new_date);
}

$(document).ready(function(){
    $('#hotelgallery a.hga').lightBox({
        fixedNavigation:true,
        imageLoading: '/images/lightbox/lightbox-ico-loading.gif',
        imageBtnClose: '/images/lightbox/lightbox-btn-close.gif',
        imageBtnPrev: '/images/lightbox/lightbox-btn-prev.gif',
        imageBtnNext: '/images/lightbox/lightbox-btn-next.gif'
    });


    // Uncomment line below to have ajax call every 60 seconds.
    //requestPostAjax();
    if (!$.browser.msie)
    {
        $(document).click(function(event){
            if(status_logindiv)
                closelogindiv(event);
        });

        $(document).keydown(function(event){
            if(status_logindiv && event.keyCode == 27)
                closelogindiv(event);
        });
    }
    $('#searchForm').submit(function() {
        if($("#geoname_id").val().length) {
            return true;
        }
        $("#nogid").animate({height:25},"fast");
        return false;
    });

});


var status_logindiv = false;
function opencallpop() {
    window.open( 'popup.html', 'pop', "width=540, height=460, left=100, top=50, location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no" );
}
function openlogindiv(e) {
    $("#loginopen").animate({opacity: "show" },'fast');
    status_logindiv = true;
    if (!$.browser.msie)
        e.stopPropagation();
}
function closelogindiv(e) {
    $("#loginopen").animate({opacity: "hide" },'fast');
    status_logindiv = false;
    if (!$.browser.msie)
        e.stopPropagation();
}

function top_des(str)
{
    location.replace(str+'&cinday='+$('#cinday').val()+'&cinmonth='+$('#cinmonth').val()+'&cinyear='+$('#cinyear').val()
        +'&cotday='+$('#cotday').val()+'&cotmonth='+$('#cotmonth').val()+'&cotyear='+$('#cotyear').val()
        +'&numbers='+$('select.selnumbers').val()+'&rooms='+$('select.selroom').val()+'&go=Search');
//  $("#"+id).attr("href",str+'&cinday='+$('#cinday').val()+'&cinmonth='+$('#cinmonth').val()+'&cinyear='+$('#cinyear').val()
//                          +'&cotday='+$('#cotday').val()+'&cotmonth='+$('#cotmonth').val()+'&cotyear='+$('#cotyear').val()
//                         +'&numbers='+$('select.selnumbers').val()+'&rooms='+$('select.selroom').val()+'&go=Search');
}

//================================= MAP FUNCTIONAL =====================================
var Country = new Array();
Country[101]="Morocco";
Country[102]="Algeria";
Country[103]="Tunisia";
Country[104]="Libya";
Country[105]="Guinea";
Country[106]="Sierra Leone";
Country[107]="Liberia";
Country[108]="Cote dIvoire";
Country[109]="Burkina Faso";
Country[110]="Burundi";
Country[111]="Central African Republic";
Country[112]="Congo";
Country[113]="DR Congo";
Country[114]="Angola";
Country[115]="Madagascar";
Country[116]="Djibouti";
Country[117]="Somalia";
Country[118]="Western Sahara";
Country[119]="Mauritania";
Country[120]="Mali";
Country[121]="Niger";
Country[122]="Chad";
Country[123]="Sudan";
Country[124]="Gambia";
Country[125]="Eritrea";
Country[126]="Zimbabwe";
Country[127]="Zambia";
Country[128]="Uganda";
Country[129]="Togo";
Country[130]="Tanzania";
Country[131]="Swaziland";
Country[132]="Senegal";
Country[133]="Rwanda";
Country[134]="Nigeria";
Country[135]="Namibia";
Country[136]="Mozambique";
Country[137]="Malawi";
Country[138]="Lesotho";
Country[139]="Kenya";
Country[140]="Guinea-Bissau";
Country[141]="Ghana";
Country[142]="Gabon";
Country[143]="Ethiopia";
Country[144]="Equatorial Guinea";
Country[145]="Egypt";
Country[146]="Cameroon";
Country[147]="Botswana";
Country[148]="Benin";
Country[149]="South Africa";
Country[150]="Mauritius";
Country[151]="Sao Tome and Principe";
Country[152]="Seychelles";
Country[153]="Zanzibar";
Country[154]="Comoros";
Country[155]="Cape Verde";
Country[201]="Cuba";
Country[202]="Puerto Rico";
Country[203]="Jamaica";
Country[204]="Belize";
Country[205]="Canada";
Country[206]="Panama";
Country[207]="Costa Rica";
Country[208]="United States";
Country[209]="Nicaragua";
Country[210]="Mexico";
Country[211]="Honduras";
Country[212]="Haiti";
Country[213]="Guatemala";
Country[214]="Greenland";
Country[215]="El Salvador";
Country[216]="Dominican Republic";
Country[217]="Antigua and Barbuda";
Country[218]="Bahamas";
Country[219]="Barbados";
Country[220]="Dominica";
Country[221]="Martinique";
Country[222]="Saint Lucia";
Country[223]="Saint Vincent and the Grenadines";
Country[224]="Grenada";
Country[225]="Trinidad and Tobago";
Country[226]="Saint Kitts and Nevis";
Country[303]="Peru";
Country[304]="Venezuela";
Country[305]="Uruguay";
Country[306]="Suriname";
Country[307]="Paraguay";
Country[308]="Guyana";
Country[309]="French Guiana";
Country[310]="Ecuador";
Country[311]="Colombia";
Country[312]="Chile";
Country[313]="Brazil";
Country[314]="Bolivia";
Country[315]="Argentina";
Country[401]="Afghanistan";
Country[402]="Singapore";
Country[403]="Turkey";
Country[404]="Yemen";
Country[405]="Vietnam";
Country[406]="Uzbekistan";
Country[407]="United Arab Emirates";
Country[408]="Turkmenistan";
Country[409]="Thailand";
Country[410]="Tajikistan";
Country[411]="Kyrgyzstan";
Country[412]="Syrian Arab Republic";
Country[413]="Sri Lanka";
Country[414]="Saudi Arabia";
Country[415]="Philippines";
Country[416]="Palestine";
Country[417]="Pakistan";
Country[418]="Oman";
Country[419]="Nepal";
Country[420]="Burma";
Country[421]="Mongolia";
Country[422]="Malaysia";
Country[423]="Lebanon";
Country[424]="Laos";
Country[425]="Kuwait";
Country[426]="South Korea";
Country[427]="North Korea";
Country[428]="Kazakhstan";
Country[429]="Jordan";
Country[430]="Japan";
Country[431]="Israel";
Country[432]="Iraq";
Country[433]="Iran";
Country[434]="Indonesia";
Country[435]="India";
Country[436]="China";
Country[437]="Cambodia";
Country[438]="Brunei Darussalam";
Country[439]="Bhutan";
Country[440]="Bangladesh";
Country[441]="Bali";
Country[442]="Qatar";
Country[443]="Bahrain";
Country[444]="Maldives";
Country[445]="East Timor";
Country[501]="Nauru";
Country[502]="Solomon Islands";
Country[503]="Papua New Guinea";
Country[504]="New Caledonia";
Country[505]="Tonga";
Country[506]="Vanuatu";
Country[507]="Samoa";
Country[508]="New Zealand";
Country[509]="Fiji";
Country[510]="Australia";
Country[511]="Kiribati";
Country[512]="Marshall Islands";
Country[513]="Micronesia";
Country[514]="Tuvalu";
Country[515]="Palau";       
Country[601]="Azerbaijan";
Country[602]="Armenia";
Country[603]="Iceland";
Country[604]="Georgia";
Country[605]="Moldova";
Country[606]="Cyprus";
Country[607]="Serbia";
Country[608]="Kosovo";
Country[609]="Portugal";
Country[610]="United Kingdom";
Country[611]="Ukraine";
Country[612]="Switzerland";
Country[613]="Sweden";
Country[614]="Spain";
Country[615]="Slovenia";
Country[616]="Slovakia";
Country[617]="Romania";
Country[618]="Poland";
Country[619]="Norway";
Country[620]="Netherlands";
Country[621]="Montenegro";
Country[622]="Macedonia";
Country[623]="Luxembourg";
Country[624]="Lithuania";
Country[625]="Liechtenstein";
Country[626]="Latvia";
Country[627]="Italy";
Country[628]="Ireland";
Country[629]="Hungary";
Country[630]="Greece";
Country[631]="Germany";
Country[632]="France";
Country[633]="Finland";
Country[634]="Estonia";
Country[635]="Denmark";
Country[636]="Czech Republic";
Country[637]="Croatia";
Country[638]="Bulgaria";
Country[639]="Bosnia and Herzegovina";
Country[640]="Belgium";
Country[641]="Belarus";
Country[642]="Austria";
Country[643]="Albania";
Country[644]="Russian Federation";
Country[645]="Malta";
Country[646]="Andorra";
Country[647]="Monaco";
Country[648]="San Marino";

var Parts = new Array();
Parts[1] = "Africa";
Parts[2] = "North America";
Parts[3] = "South America";
Parts[4] = "Asia";
Parts[5] = "Australia";
Parts[6] = "Europe";

var Po = new Array();
Po[1] = 1;
Po[2] = 2;
Po[3] = 3;
Po[4] = 4;
Po[5] = 5;
Po[6] = 6;

var CurrentPart = 0;

function initmap(Nom) {
    CurrentPart = Nom;
    FlashGoCountry(0);
    
    DrowContinentList(Nom);
    $("#maptitle").html('<a href="javascript:void(0);" onclick="JSGoPart('+Nom+'); return false;">'+Parts[Nom]+'</a><span style="margin-left:7px;" id="cntry"></span>');

}

function DrowContinentList(Nom) {
    var tmp = '';
    for ( var i = 1; i <= 6; i++ ) {
        if ( Po[i] == Nom ) {
            tmp += '<span>'+Parts[Po[i]]+'</span> | ';
        }
        else {
            tmp += '<a href="javascript:void(0);" onclick="JSGoPart('+Po[i]+'); return false;">'+Parts[Po[i]]+'</a> | ';
        }
    }
    tmp = tmp.substr(0, tmp.length-3);
    $("#mapparts").html(tmp);
}

function JSGoPart(Nom) {
        initmap(Nom);
        showsmallmap(Nom);
	document.getElementById("mapnew2").SetVariable("_root.htmlgo", Nom);
	document.getElementById("mapnew2").TCallFrame("_root.js",1);
}
function JSGoCountry(Nom) {
	document.getElementById("mapnew2").SetVariable("_root.htmlgocountry", Nom);
	document.getElementById("mapnew2").TCallFrame("_root.js",2);

        FlashGoCountry(Nom);
}
function FlashGoCountry(Nom) {
    DrowContinentList();
//	var date = new Date();
//	var time = date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();
//
//	var tmp = document.getElementById("mbox2").innerHTML;
//	document.getElementById("mbox2").innerHTML = tmp + "<hr>"+time+":Flash - Click to "+Nom;

    var tmp1 = '';
    var tmp2 = '';
    var tmp3 = '';
    var tmp4 = '';
    var tmp;
    var topcnt = "";

    var CB = 0;

    var assoc = new Object;
    var keys = new Array();
    for ( var i = 1; i <= 99; i++ ) {
        if ( typeof(Country[100*CurrentPart+i]) == "string" ) {
            assoc[Country[100*CurrentPart+i]] = 100*CurrentPart+i;
            keys[i-1] = Country[100*CurrentPart+i];
        }
    }


    keys.sort();

    for ( var i = 0; i <= 99; i++ ) {
        if ( typeof(keys[i]) == "string" ) {
            CB++;
            if ( CB == 5 ) {
                CB = 1;
            }
            if (1 || i != Nom ) {
                tmp = '<img style="margin-top:5px;" src="/images/new/flag/16/'+keys[i]+'.png" alt="'+keys[i]+'" title="'+keys[i]+'" />   <a title="'+keys[i]+'" style="position:absolute; margin-top:3px; margin-left:7px; width:128px; overflow:hidden; white-space:nowrap; " href="javascript:void(0);" onclick="JSGoCountry('+(assoc[keys[i]])+'); return false;">'+((keys[i].length > 18) ? keys[i].substring(0, 15)+'..' : keys[i]) +"</a><br>";
            }
            if ( CB == 1 ) {
                tmp1 += tmp;
            }
            else if ( CB == 2 ) {
                tmp2 += tmp;
            }
            else if ( CB == 3 ) {
                tmp3 += tmp;
            }
            else if ( CB == 4 ) {
                tmp4 += tmp;
            }
        }
    }
    tmp = "<div id='cnt1'>"+tmp1+"</div>";
    tmp += "<div id='cnt2'>"+tmp2+"</div>";
    tmp += "<div id='cnt3'>"+tmp3+"</div>";
    tmp += "<div id='cnt4'>"+tmp4+"</div>";
    $('#mappartcont').html(tmp);
    $("#maptitle span#cntry").html(">"+topcnt);

    if(Nom > 0) {
        $.post(
            "/en/flashMap/getCities/?id="+Nom,
            null,
            function(res) {
                var xml;
                if (typeof res == "string") {
                    xml = new ActiveXObject("Microsoft.XMLDOM");
                    xml.async = false;
                    xml.loadXML(res);
                } else {
                    xml = res;
                }

                cityXmlParser(xml);

            },
            ($.browser.msie) ? "text" : "xml");
    }
    if(Nom > 0) {
        var partCnt=Nom.toString().substring(0, 1);
        //ind = parseInt(ind, 10);
        tmp = '<a href="javascript:void(0);" onclick="JSGoPart('+partCnt+'); return false;">'+Parts[partCnt]+'</a> | '+Country[Nom];
        document.getElementById("maptitle").innerHTML = tmp;
    }
}

function cityXmlParser(xml) {
    var CitiesList = [];
    var orders = [];
    var hash = new Object();
    var j = 0;
    //alert($(xml)[0].attr("id"));
    $(xml).find("city").each(function () {
        CitiesList[$(this).attr('id')] = $(this).attr('name');
        orders[j++] = $(this).attr('name');
        hash[$(this).attr('name')] = $(this).attr('id');
    });

    orders.sort()
    //CitiesList.sort();

    var tmp1 = '';
    var tmp2 = '';
    var tmp3 = '';
    var tmp4 = '';
    var tmp;
    var topcnt = "";

    var CB = 0;

    for ( o in orders ) {
        i = hash[orders[o]];
        if ( typeof(CitiesList[i]) == "string" ) {
            CB++;
            if ( CB == 5 ) {
                CB = 1;
            }
            tmp = '<a onmouseover="ShowCity('+i+');" onmouseout="HideCity('+i+');" href="/en/flashMap/go2city?id='+i+'" >'+CitiesList[i]+"</a><br>";
            if ( CB == 1 ) {
                tmp1 += tmp;
            }
            else if ( CB == 2 ) {
                tmp2 += tmp;
            }
            else if ( CB == 3 ) {
                tmp3 += tmp;
            }
            else if ( CB == 4 ) {
                tmp4 += tmp;
            }
        }
    }
    tmp = "<div id='cnt1'>"+tmp1+"</div>";
    tmp += "<div id='cnt2'>"+tmp2+"</div>";
    tmp += "<div id='cnt3'>"+tmp3+"</div>";
    tmp += "<div id='cnt4'>"+tmp4+"</div>";
    $('#mappartcont').html(tmp);
//$("#maptitle span#cntry").html(">"+topcnt);
}
function showsmallmap(Nom) {
    for ( var i = 1; i <= 6; i++ ) {
        if ( i == Nom ) {
            $("#rightmap"+i).animate({opacity: "show"}, "slow");
        }
        else {
            $("#rightmap"+i).animate({opacity: "hide"}, "fast");
        }
    }
}
function gosmallmap(Nom) {
    JSGoPart(Nom);
}
function ShowCity(Id) {
 document.getElementById("mapnew2").SetVariable("_root.showcity", Id);
 document.getElementById("mapnew2").TCallFrame("_root.js",3);
}
function HideCity(Id) {
 document.getElementById("mapnew2").SetVariable("_root.showcity", Id);
 document.getElementById("mapnew2").TCallFrame("_root.js",4);
} 
//================================= MAP FUNCTIONAL =====================================


function openComunicationWindow(url, params, title, args, staticErrorUrl) {
    if (params[0] == '' || params[1] != 'TRUE') {
        window.open(staticErrorUrl, title, args);
    }
    else {
        window.open(url, title, args);
    }
}




//=============================== Facebook Functions ====================================

function fb_after_login(returl) {
    document.location.href = returl;
}


//===============================  / Facebook Functions ====================================

function validateEmail(email) {

    var at="@";
    var point=".";
    var lat=email.indexOf(at);
    var lemail=email.length;
    var lpoint=email.indexOf(point);

    if (email!=null){
        if (email.indexOf(at)==-1){
            return false;
        }

        if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lemail){
            return false;
        }

        if (email.indexOf(point)==-1 || email.indexOf(point)==0 || email.indexOf(point)==lemail){
            return false;
        }

        if (email.indexOf(at,(lat+1))!=-1){
            return false;
        }

        if (email.substring(lat-1,lat)==point || email.substring(lat+1,lat+2)==point){
            return false;
        }

        if (email.indexOf(point,(lat+2))==-1){
            return false;
        }
    }
    return true;
}

