﻿// JScript File
var img;
var aFrontBackView = new Array();
jQuery(document).ready(function() 
{
    img = new Image();
    img.src="images/spinner.gif";
	$("a[id$='linkMainMenuItem']").click(function(){
	    $(".firstUl>li>ul").slideUp('slow');
	    $(this).next().slideToggle('slow');
	});
	
	$("[rel='doClick']").parent().css("height", "auto");
	$("[rel='doClick']").next().attr("class", "submenu_in_doclick");
	
	$(".secondLi[rel!='doClick']").hover(
	    function () 
	    {
	        if ($(this).children(".thirdUl").children("li").length > 0)
	        {
	            $(this).children(".thirdUl").css("display", "block"); 
	            
	        }
	    }, 
	    function() 
	    {
	        $(this).children(".thirdUl").css("display", "none");
	    } 
	 );
	 
	
	$(".secondLi, .secondLinkClothes").hover(
	    function() {$(this).css('backgroundColor','#B4B4B4'); $(this).css('color','#ffffff');}, 
	    function() {$(this).css('backgroundColor','#F6F6F6'); $(this).css('color','#656565');}
	);
	
	$(".thirdLink").hover(
	    function() {$(this).css('color','#F6F6F6'); $(this).children(".linkSubMenu").css('color','#ffffff');}, 
	    function() {$(this).css('color','#656565'); $(this).children(".linkSubMenu").css('color','#656565');}
	
	);
	
	$(".thirdLiClothes").hover(function() 
    {
        if ($(this).children(".fourthUl").children("li").length > 0)
        {
            $(this).children(".fourthUl").css("display","block"); 
        }
        $(this).css('backgroundColor','#B4B4B4');
    }, 
    function() {
        $(this).children(".fourthUl").css("display","none");
        $(this).css('backgroundColor','#F6F6F6');
    }
	);
	
	$(".thirdLi").hover(function() 
    {
        if ($(this).children(".fourthUl").children("li").length > 0)
        {
            $(this).children(".fourthUl").css("display","block"); 
            if ((this).hasClass('thirdLiClothes')) 
            {
                alert('');
                $(this).css('backgroundColor','#B4B4B4');
            }
        }
    }, 
    function() {
        $(this).children(".fourthUl").css("display","none");
        if ((this).hasClass('thirdLiClothes'))  $(this).css('backgroundColor','#F6F6F6');
    }
	);
	
	$(".fourthLi").hover(
	    function() {$(this).children('a').css('color','#6F6F6F');  }, //$(this).parent().parent().parent().children('.thirdLinkClothes').css('backgroundColor','#F6F6F6');
	    function() {$(this).children('a').css('color','#F6F6F6'); } //$(this).parent().parent().children('.thirdLinkClothes').css('backgroundColor','#B4B4B4');
	);
	
	
	
	
	
	
	$("a[rel^='gb_pageset']").prettyPhoto({theme:'facebook'});
	
	$('#mycarousel').jcarousel({vertical: true, scroll: 2});
	
	$(".jcarousel-skin-tango").css("zIndex","1");
	

    if (jQuery.browser.version == "7.0" && jQuery.browser.msie)
    {
        var zIndexNumber = 1000;
	    $('li').each(function() {
		    $(this).css('zIndex', zIndexNumber);
		    zIndexNumber -= 10;
	    });
	}
});



function ToogleFaq(part)
{
    if($('#p'+part).css('display')=='none')
    {
        $('#p'+part).slideDown('slow');
        $('#i_'+part).attr('src','styles/bullet_down.gif');
    }
    else
    {
       $('#p'+part).slideUp('slow');
       $('#i_'+part).attr('src','styles/bullet_left.gif');
    }
}



function MenuIn(menuId, menuOver)
{
    if($('#'+menuId).css('display')=='none' && $('#'+menuId+".thirdUl > li").length>0)
    {
        $('#'+menuId).css('display','block');
    }
    $('#'+menuOver).css('backgroundColor','#B4B4B4');
    $('#'+menuOver+".secondLi>a").css('color','#ffffff');
}

function MenuOut(menuId, menuOver)
{
    if($('#'+menuId).css('display')=='block')
    {
        $('#'+menuId).css('display','none');
    }
    $('#'+menuOver).css('backgroundColor','#F6F6F6');
    $('#'+menuOver+".secondLi>a").css('color','#656565');
}


function CreateFlashObject(LangID, FilePath, Width, Height, ClassName)
{
   
    document.write("<object " + (ClassName != "" ? "class='" + ClassName + "'" : "") + " classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + Width + "' height='" + Height + "' align='middle'>");
    document.write("<param name='allowScriptAccess' value='sameDomain'>");
    if (LangID != "")   document.write("<param name='flashvars' value='LangID=" + LangID + "'>"); 
    document.write("<param name='wmode' value='transparent'>");
    document.write("<param name='movie' value='" + FilePath + "'>");
    document.write("<param name='quality' value='high'>");
    document.write("<embed src='" + FilePath + "' quality='high' flashvars='LangID=" + LangID + "' width='" + Width + "' height='" + Height + "' align='middle' wmode='transparent' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
    document.write("</object>");
}

function ChangeBack(imgId)
{
    if($('#img_'+imgId).attr('class')=='season_image_block')
    {
        $('#img_'+imgId).attr('class','season_image_block_over')
    }
}

function ChangeBackOut(imgId)
{
    if($('#img_'+imgId).attr('class')=='season_image_block_over')
    {
        $('#img_'+imgId).attr('class','season_image_block')
    }
}

function ChangeBackCatalog(imgId)
{
    if($('#img_'+imgId).attr('class')=='season_catalog_block')
    {
        $('#img_'+imgId).attr('class','season_catalog_block_over')
    }
}

function ChangeBackOutCatalog(imgId)
{
    if($('#img_'+imgId).attr('class')=='season_catalog_block_over')
    {
        $('#img_'+imgId).attr('class','season_catalog_block')
    }
}

var imgBig, sMid, sFilename;
function LoadBigImage(mid,filename)
{
    sMid = mid;
    sFilename = filename;
    $('#BigImage').attr('src',  img.src);
    $('#BigImage').attr('class','small_preloader');
    imgBig = new Image();
    imgBig.src = 'images/style/'+mid+'/big/'+filename;
    $('#BigImageLink').attr('href','images/style/'+mid+'/large/'+filename);
    imgBig.onload = imageLoad;
}

function imageLoad()
{
    document.getElementById('BigImage').src = this.src;
    $('#BigImage').hide();
    $('#BigImage').attr('class','full-size-photo');
    $('#BigImage').fadeIn();
}
    
    
function ChangeColors(newcolor){

    var fim = 'images/catalog/BigImages/'+ newcolor;
    var bim = 'images/catalog/BigImages/back_'+ newcolor;
    
    
    aFrontBackView[0] = fim; 
    aFrontBackView[1] = bim;
  
    $('#BigImagesView').attr("src", aFrontBackView[0]);
    
    return;
    
    
    if ($('lback').style.display!='none'){
        
        $('BigImagesView').src= aFrontBackView[0];
    }else{
        $('BigImagesView').src= aFrontBackView[1];
    }
    
    return false;
}

function ChangeView(t){
    if (t=='front'){
        $('lfront').style.display = '';
        $('lback').style.display = 'none';
        $('BigImagesView').src= aFrontBackView[1];
        $('lLargeImage').style.display = 'none';
        $('lLargeImageBack').style.display = '';
    }else{
        $('lfront').style.display = 'none';
        $('lback').style.display = '';
        $('BigImagesView').src= aFrontBackView[0];
        $('lLargeImage').style.display = '';
        $('lLargeImageBack').style.display = 'none';
    }
    return false;
}

function changeDescrJurn(num, name)
{
    if($('#'+name+num).css('display')=='none')
    {
        for( var i=1; i<=7; i++)
        {
            $('#'+name+i).css('display','none');
        }
        $('#'+name+num).fadeIn('slow');
    }
    
    $('#j_'+num).prevAll().attr('class','jurn_cont');
    $('#j_'+num).nextAll().attr('class','jurn_cont');
    $('#j_'+num).attr('class','jurn_cont_curent');
    
    
    return false;
}

function changeDescr(num, name)
{
    if($('#'+name+num).css('display')=='none')
    {
        for( var i=1; i<=6; i++)
        {
            $('#'+name+i).css('display','none');
        }
        $('#'+name+num).fadeIn('slow');
    }
    
    $('#card_'+num).prevAll().attr('class','bank_cont');
    $('#card_'+num).nextAll().attr('class','bank_cont');
    $('#card_'+num).attr('class','bank_cont_curent');
    
    $('#clubS_'+num).prevAll().attr('class','bank_cont');
    $('#clubS_'+num).nextAll().attr('class','bank_cont');
    $('#clubS_'+num).attr('class','bank_cont_curent');
    
    $('#sertA_'+num).prevAll().attr('class','bank_cont');
    $('#sertA_'+num).nextAll().attr('class','bank_cont');
    $('#sertA_'+num).attr('class','bank_cont_curent');
        
    return false;
}

function ChangeIcoPhoto(photo)
{
    if($('#'+photo).attr('class')=='bank_cont')
    {
        $('#'+photo).attr('class','bank_cont_over');
    }
}

function ChangeIcoPhotoBack(photo)
{
    if($('#'+photo).attr('class')=='bank_cont_over')
    {
        $('#'+photo).attr('class','bank_cont');
    }
}

function ChangeIcoJurn(ico)
{
    if($('#'+ico).attr('class')=='jurn_cont')
    {
        $('#'+ico).attr('class','jurn_cont_over');
    }
}

function ChangeIcoJurnBack(ico)
{
    if($('#'+ico).attr('class')=='jurn_cont_over')
    {
        $('#'+ico).attr('class','jurn_cont');
    }
}

