// JScript File
function openAddProperyWindow(url, height, width)
{
    window.open(url,'productAttributeValue','height=' + height + ',width=' + width + ',statusbar=0,resizable=no,toolbar=no,menubar=no,scrollbars=yes');
    alert(2)
    return false;
}

function jumpToURL(ddlURL)
{
    window.location.href=ddlURL.options[ddlURL.selectedIndex].value;
}

function setStatusBarText(txtStatus){
	window.status=txtStatus;return true}

function checkEnterForFormSubmit(e, o){ //e is event object passed from function invocation
var characterCode                       //literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
o.form.submit() //submit the form
return false 
}
else{
return true 
}
}

function handleEnterForSearch(button, event, buttonID){
  var keyCode = event.keyCode
		if (keyCode == 13) 
		  {
		    var button = document.getElementById(buttonID);
		    event.cancelBubble = true; 
		    event.returnValue = false;
		    event.cancel = false;
		    button.click();
  }
}

function clearMe(defaultVal, txtBox)
{
   if (txtBox.value==defaultVal){
    txtBox.value='';
   }
}

/* OPEN IMAGES IN NEW WINDOW (auto size) */
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.
PositionX = 100;
PositionY = 100;

defaultWidth  = 900;
defaultHeight = 700;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["Slika"].width;');writeln('window.innerHeight=document.images["Slika"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()" onclick="self.close()" style="cursor: hand;">');
writeln('<img name="Slika" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

var menuTimeout=null;

function ShowMenuDivWithTimeout(_counter){
    if(menuTimeout!=null)
    {
      clearTimeout(menuTimeout);
    }
    menuTimeout=setTimeout('ShowMenuDiv(' + _counter + ')',150);
}

function ShowMenuDiv(_counter){
        //first we hide all divs
        for(i=0;i<30;i++){
                HideMenuDiv(i);
        }        
        
        for(i=0;i<30;i++){
            if ((i==_counter) && document.getElementById('mm_item_' + _counter)){
                document.getElementById('mm_item_' + _counter).style.display='block';
                document.getElementById('ctl00_ctl00_PageHeader1_SiteMenuSpecial1_rptMenuSpecial_ctl0' + _counter + '_lnkMenuItem').className = 'mmh';
            }
            else {
                 //document.getElementById('ctl00_ctl00_PageHeader1_SiteMenuSpecial1_rptMenuSpecial_ctl0' + _counter + '_lnkMenuItem').className = 'mm';
            }
        }
}

function HideMenuDiv(_counter){
    if(menuTimeout!=null)
    {
      clearTimeout(menuTimeout);
    }
    
    for(i=0;i<30;i++){
        _counter=i;
        if (document.getElementById('mm_item_' + _counter)){
            document.getElementById('mm_item_' + _counter).style.display='none';
            document.getElementById('ctl00_ctl00_PageHeader1_SiteMenuSpecial1_rptMenuSpecial_ctl0' + _counter + '_lnkMenuItem').className= 'mm';
        }
    }
    
}

function ShowSearchDiv(val){
    document.getElementById('where_popup').style.display='block';
}

function HideSearchDiv(){    
    document.getElementById('where_popup').style.display='none';
}

function ShowProdColourListDiv(){
    document.getElementById('choose_color').style.display='block';
}

function HideProdColourListDiv(){    
    document.getElementById('choose_color').style.display='none';
}

function ShowSelProdColourDiv(){
  document.getElementById('sel_opt').style.display='block';
}
function SHProdColourListDiv(){
    var tip = document.getElementById('selected_option').style.display;
    
    if (tip =='block')
    {
      document.getElementById('choose_color').style.display='block';
    }else{
      document.getElementById('choose_color').style.display='none';
    }
}

var showedDIV;

function SHProdCompleteByProdID(divname){
  
  obj = document.getElementById('divAttributes_'+showedDIV);
  obj.style.display = 'none';
    
  var obj = document.getElementById('divAttributes_'+divname);
  obj.style.display = 'block';
  
  showedDIV = divname;
  
}

function SHOceniIzdelekDiv(divname){
    
    var obj = document.getElementById(divname);
	
	  if (obj.style.display == 'none')
	  {
		  obj.style.display = 'block';
		}
	  else
	  {
		  obj.style.display = 'none';
		}
}


function ToggleMenu(val){
    if (val==1){
        document.getElementById('Menu1Top').className = 'lam_option_on';
        document.getElementById('Menu2Top').className = 'lam_option_off';
        document.getElementById('ctl00_ctl00_MainContentPlaceholder_MainContentPlaceholder_Menu1').style.display='block';
        document.getElementById('ctl00_ctl00_MainContentPlaceholder_MainContentPlaceholder_Menu2').style.display='none';
    }
    else{
        document.getElementById('Menu1Top').className = 'lam_option_off';
        document.getElementById('Menu2Top').className = 'lam_option_on';
        document.getElementById('ctl00_ctl00_MainContentPlaceholder_MainContentPlaceholder_Menu1').style.display='none';
        document.getElementById('ctl00_ctl00_MainContentPlaceholder_MainContentPlaceholder_Menu2').style.display='block';
    }
}

//custom options
function OpenPopupOptions(url, options){
  //MyWindow=window.open('popups/popup_template.shtml','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=300'); return false;
  var _win = null
  _win = window.open(url, 'bigbangPopup', options); 
  if (window.focus) {_win.focus()}
  return _win==null;
}

//custom dimensions
function OpenPopup(url, width, height){
  var options='toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ' ,height=' + height;
  return OpenPopupOptions(url, options); 
}


