<!--
function openWindow(url, style){
	if(style == null){
		style = "status=0,scrollbars=0,center=1,resizable=1,toolbar=0,location=0,directories=0,menubar=0,width=700,height=450";
	}
	var nw = window.open(url, 'VIWin', style);
}

function openGallery(url)
{
    var w = window.screen.availWidth-10;
    var h = window.screen.availHeight-10;
    var s = "width="+w+",height="+h+",top=0,left=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1";
    openWindow(url,s);
}

function checkemail(str){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
		return true;
	else{
		return false;
	}
}

function subscribe()
{
    var email = $("#txtEmail").val();
    var key = $("#key").val();
    if(checkemail(email))
    {
        $("#btnRegNewsLetter").attr("disabled","true");
        $.get("Newsletter/Register.ashx", { email: email, key: key },
            function(data){
                alert(data);
                $("#btnRegNewsLetter").removeAttr("disabled");
            });
        
    }else
    {
        alert(msgs[0]);        
    }

}


function ShowSearchResultsDetails(off_id,s_id)
{
    var eleID = "#pnlDetails"+off_id;
    var shorteleID = "#pnlShortDetails"+off_id;
    try{
        if(!$(eleID).is(':visible'))
        {
            //GetStructureMapPoints('it',s_id,off_id);
            $(eleID).slideDown();
            $(shorteleID).slideUp();
        }
        else
        {
            $(eleID).slideUp();
            $(shorteleID).slideDown();
        }
        
    }catch(e){}
}

function GetDistricts(regionID,lang)
{
    LocationsWS.GetDistrictsWithOffers(lang,regionID,OnGetDistrictsWithOffersCompleted,OnWSError);
    
}

function OnGetDistrictsWithOffersCompleted(result)
{
}

function OnWSError(result)
{
    alert(result.get_message());
}

function SelectTreatment(oID,tID)
{
    try{
        var selDep = $("[name=dID"+oID+"]:checked").val();
        if(!selDep)
            selDep=0;
        $("#lnkBook"+oID).attr("href","od/"+oID+"_t"+tID+(selDep>0?("_d"+selDep):"")+".aspx");
    }catch(e){}
}
function SelectDeparture(oID,dID)
{
    try{
        var selTreat = $("[name=tID"+oID+"]:checked").val();
        if(!selTreat)
            selTreat=0;
        $("#lnkBook"+oID).attr("href","od/"+oID+(selTreat>0?("_t"+selTreat):"")+"_d"+dID+".aspx");
    }catch(e){}
}

function InitPage()
{
    try{
        var lBox= $get("landingBox");
        if(lBox!=null)
        {
             var landPnl= $get("landPnl");
             if(landPnl!=null)
             {
                lBox.style.display="block";
                landPnl.appendChild(lBox);
                var scrollConfig = {id:'menu' ,step:10 ,ms:80 , minLeft:10 , maxLeft:-10000};
	            if (!document.layers) { wm1 = new wmrScroller(scrollConfig) };
            
             }
        }
    }catch(e){}
}

function gMapStructWS()
{
    return Nicolaus.Services.gMapStructures;
}

var s_cache;

function GetStructureMapPoints(lang,ids,oID)
{
    try
    {
        if(s_cache==null)
            s_cache = new Array();
        
        for(i=0;i<s_cache.length;i++)
        {
            if(s_cache[i].ID==ids)
            {
                GetStructureMapPointsCompleted([s_cache[i]],oID);
                return;
            }
        }
    
        gMapStructWS().GetStructuresMapPoints(lang,[ids], GetStructureMapPointsCompleted,OnWSError,oID);
    }catch(e){}
}

function GetStructureMapPointsCompleted(data,oID)
{
    if(data!=null && data.length>0)
    {
        var s = data[0];
        $("#sDesc"+oID).html(s.ShortDescription);
        s_cache.push(s);
    }
}


function MakeGallery(structureID)
{
    var tmp = eval("s_img_"+structureID);
    jQuery.slimbox(tmp, 0, {loop: true});
}

function OpenPrices()
{
    if(attachments && attachments.length==1)
    {
        window.open(attachments[0]);
    }    
}

//-->