﻿/// <reference path="jquery-1.2.3.pack.js" />
function ViewPage(id) {
    switch(id)
    {
        //ladda om sidan när dessa visas
        case 5887:
        case 5939:
        case 5963:
		case 6733:
        case 5943:
        case 6720:
             Goto(id);
            break;
        default:
            if ($("#CurrentPageId").val() == 6720)
            {
                Goto(id);
            }
            else
            {
                
                $.get('../Data/GetTemplate.aspx?id=' + id,
                    function(Url){
                      if(Url.indexOf('.aspx') > 0)
                      {
                        $("#mainWrap").load(Url+" #mainWrap > div");
                        $("#footer").load(Url + " #footer > div");
                        
                      }
                    });
            }
            
        break;
    }
    
    $("#CurrentPageId").val(id);
}


function Goto(id)
{
    location.href='Redirect.aspx?id='+id;
}

function Search(key)
{
    location.href='Search.aspx?Sectionid=5963&search=' + key;
}

function ChangeLanguage(id) {
    if (id == 1)
        location.href = location.href.toLowerCase().replace('.eu', '.se');
    else
        location.href = location.href.toLowerCase().replace('.se', '.eu');
}


function ViewLargeProdImage()
{
    $("#prodLargeImage").fadeIn("slow");
}

function CloseLargeProdImage()
{
    $("#prodLargeImage").fadeOut("slow");
}


function OpenWindow(url,width,height)
{
    window.open(url,'','scrollbars=yes,left=300,top=300,,height='+height+',width='+width);
}

function TipAFriend(id)
{
     OpenWindow('PrimusWasHereTip.aspx?SectionId='+id,300,400);
}