function checkMail(email){
    if(email.length<7){
    	return false
    }
    else{
       if((email.indexOf("@")==-1)||(email.indexOf(".")==-1)){
          return false
       }
       else{
       	 last = lastIndex(".", email);
         if((email.indexOf("@")==0)||(last>(email.length-3))||(email.indexOf("@")>lastIndex(".", email))){
            return false
         }
         else{
           var nr=numberOf("@", email)
           var nr2=numberOf(".", email)
           if((nr>1)||(nr2>5)){
              return false
           }
           else return true
         }
       }
    }
}

function switcher()
{
        $("#submenu").css("display","none");
        $(".menu").css("height","44px");
        
        $("#switch").html("<div id='switch_off' onclick='switcher_on()'></div>");
}

function switcher_on()
{
        $("#submenu").css("display","block");
        $(".menu").css("height","194px");

        $("#switch").html("<div id='switch_on' onclick='switcher()'></div>");
}

function load_img()
{
            var res = screen.width;
            var wid = $(".header").width() - (res * (1.3/100));
            var wids = wid.toString() + "px";

            if (res < 1147)
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1007.png' />");
                $("#subheader img").css("width",wids);
            }
            else if ((res >= 1147) && (res < 1300))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1207.png' />");
                $("#subheader img").css("width",wids);
            }
            else if ((res >= 1300) && (res < 1500))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1407.png' />");
                $("#subheader img").css("width",wids);
            }
            else if ((res >= 1500) && (res < 1700))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1607.png' />");
                $("#subheader img").css("width",wids);
            }
            else if ((res >= 1700) && (res < 1900))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1807.png' />");
                $("#subheader img").css("width",wids);
            }
            else if (res >= 1900)
            {
                $("#subheader").html("<img src='images/home_sizes/subheader2000.png' />");
                $("#subheader img").css("width",wids);
            }
}

function load_img1()
{
            var res1 = screen.width;
            var wid1 = $(".header").width();
            var wid1s = wid1.toString() + "px";

            if (res1 < 1147)
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1007.png' />");
                $("#subheader img").css("width",wid1s);
            }
            else if ((res1 >= 1147) && (res1 < 1300))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1207.png' />");
                $("#subheader img").css("width",wid1s);
            }
            else if ((res1 >= 1300) && (res1 < 1500))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1407.png' />");
                $("#subheader img").css("width",wid1s);
            }
            else if ((res1 >= 1500) && (res1 < 1700))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1607.png' />");
                $("#subheader img").css("width",wid1s);
            }
            else if ((res1 >= 1700) && (res1 < 1900))
            {
                $("#subheader").html("<img src='images/home_sizes/subheader1807.png' />");
                $("#subheader img").css("width",wid1s);
            }
            else if (res1 >= 1900)
            {
                $("#subheader").html("<img src='images/home_sizes/subheader2000.png' />");
                $("#subheader img").css("width",wid1s);
            }
}

function load_intro()
{
            var intro = screen.width;
            var xz = intro - (intro * (1.3/100));
            var inw = xz.toString() + "px";

           if (intro < 1147)
            {
                $("#intropic").html("<img src='images/intro_sizes/intro1.png' />");
                $("#intropic img").css("width",inw);
                $("#logo").html("<img src='images/intro_sizes/logo0.png' />");
                $("#ct").css("height","116px");
                $("#ct").css("width","290px");
                $("#holder").css("width","290px");
                $("#holder").css("height","153px");
                $("#holder").css("background-image", "url(images/intro_sizes/all3.png)");
                $("#langhold").css("height","40px");
                $("#langhold").css("width","158px");

            }
            else if ((intro >= 1147) && (intro < 1300))
            {
                $("#intropic").html("<img src='images/intro_sizes/intro2.png' />");
                $("#intropic img").css("width",inw);
                $("#logo").html("<img src='images/intro_sizes/logo01.png' />");
                $("#ct").css("height","133px");
                $("#ct").css("width","330px");
                $("#holder").css("width","330px");
                $("#holder").css("height","175px");
                $("#holder").css("background-image", "url(images/intro_sizes/all4.png)");
                $("#langhold").css("height","45px");
                $("#langhold").css("width","180px");
            }
            else if ((intro >= 1300) && (intro < 1500))
            {
                $("#intropic").html("<img src='images/intro_sizes/intro3.png' />");
                $("#intropic img").css("width",inw);
                $("#logo").html("<img src='images/intro_sizes/logo02.png' />");
                $("#ct").css("height","133px");
                $("#ct").css("width","330px");
                $("#holder").css("width","330px");
                $("#holder").css("height","175px");
                $("#holder").css("background-image", "url(images/intro_sizes/all4.png)");
                $("#langhold").css("height","45px");
                $("#langhold").css("width","180px");
            }
            else if ((intro >= 1500) && (intro < 1700))
            {
                $("#intropic").html("<img src='images/intro_sizes/intro4.png' />");
                $("#intropic img").css("width",inw);
                $("#logo").html("<img src='images/intro_sizes/logo3.png' />");
                $("#ct").css("height","175px");
                $("#ct").css("width","434px");
                $("#holder").css("width","434px");
                $("#holder").css("height","230px");
                $("#holder").css("background-image", "url(images/intro_sizes/all5.png)");
                $("#langhold").css("height","60px");
                $("#langhold").css("width","236px");
            }
            else if ((intro >= 1700) && (intro < 1900))
            {
                $("#intropic").html("<img src='images/intro_sizes/intro5.png' />");
                $("#intropic img").css("width",inw);
                $("#logo").html("<img src='images/intro_sizes/logo4.png' />");
                $("#ct").css("height","175px");
                $("#ct").css("width","434px");
                $("#holder").css("width","434px");
                $("#holder").css("height","230px");
                $("#holder").css("background-image", "url(images/intro_sizes/all5.png)");
                $("#langhold").css("height","60px");
                $("#langhold").css("width","236px");
            }
            else if (intro >= 1900)
            {
                $("#intropic").html("<img src='images/intro_sizes/intro6.png' />");
                $("#intropic img").css("width",inw);
                $("#logo").html("<img src='images/intro_sizes/logo4.png' />");
                $("#ct").css("height","205px");
                $("#ct").css("width","522px");
                $("#holder").css("width","522px");
                $("#holder").css("height","276px");
                $("#holder").css("background-image", "url(images/intro_sizes/all6.png)");
                $("#langhold").css("height","71px");
                $("#langhold").css("width","284px");
            }
}

function hslide(txt,txt1)
{
        $("#slide").css("display","none");
        var text1 = "<div id='pu_dn' onclick='sslide(\""+txt+"\",\""+txt1+"\")'>"+txt1+"</div>";

        $("#prev_up").html(text1);
        $("#prev_up").css("margin-top","10px");
}

function sslide(txt2,txt3)
{
        $("#slide").css("display","block");
        var text2 = "<div id='pu_up' onclick='hslide(\""+txt2+"\",\""+txt3+"\")'>"+txt2+"</div>";

        $("#prev_up").html(text2);
        $("#prev_up").css("margin-top","-64px");
}

function hcamp00()
    {
        $('#cj').css('display','none');
        $("#nush").html("<div id='prev_dn' onclick='hcamp11()'>Vezi campania in poze</div>");
    }
    function hcamp11()
    {
        $('#cj').css('display','block');
        $("#nush").html("<div id='prev_dn' onclick='hcamp00()'>Vezi campania in poze</div>");
    }
