// JavaScript Document// *******************// * SHOPIX // * Moonlake.cz// * Petr Sládek// *******************      var attributes = {};      var params = {wmode:"transparent"};      var flashvars = {}; // Cookies function  // ------------------   function getCookie(c_name){  if (document.cookie.length>0)  {    c_start=document.cookie.indexOf(c_name + "=");    if (c_start!=-1)    {       c_start=c_start + c_name.length+1;       c_end=document.cookie.indexOf(";",c_start);      if (c_end==-1) c_end=document.cookie.length;      return unescape(document.cookie.substring(c_start,c_end));    }   }  return "";}function setCookie(c_name,value,expiredays){  var exdate=new Date();  exdate.setDate(exdate.getDate()+expiredays);  document.cookie=c_name+ "=" +escape(value)+  ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+';path=/';}// list-catalog switch// -------------------function changeViewType(value) {  var div_view_type = document.getElementById("view_type");    div_view_type.className = value  setCookie('view_type',value,365);  //var items = $('.item'); }// Rating system// -------------function select_innerHTML(objeto,innerHTML) {/******* select_innerHTML - corrige o bug do InnerHTML em selects no IE* Veja o problema em: http://support.microsoft.com/default.aspx?scid=kb;en-us;276228* Versão: 2.1 - 04/09/2007* Autor: Micox - Náiron José C. Guimarães - micoxjcg@yahoo.com.br* @objeto(tipo HTMLobject): o select a ser alterado* @innerHTML(tipo string): o novo valor do innerHTML*******/    objeto.innerHTML = ""    var selTemp = document.createElement("micoxselect")    var opt;    selTemp.id="micoxselect1"    document.body.appendChild(selTemp)    selTemp = document.getElementById("micoxselect1")    selTemp.style.display="none"    if(innerHTML.toLowerCase().indexOf("<option")<0){//se não é option eu converto        innerHTML = "<option>" + innerHTML + "</option>"    }    innerHTML = innerHTML.toLowerCase().replace(/<option/g,"<span").replace(/<\/option/g,"</span")    selTemp.innerHTML = innerHTML              for(var i=0;i<selTemp.childNodes.length;i++){  var spantemp = selTemp.childNodes[i];          if(spantemp.tagName){                 opt = document.createElement("OPTION")       if(document.all){ //IE    objeto.add(opt)   }else{    objeto.appendChild(opt)   }              //getting attributes   for(var j=0; j<spantemp.attributes.length ; j++){    var attrName = spantemp.attributes[j].nodeName;    var attrVal = spantemp.attributes[j].nodeValue;    if(attrVal){     try{      opt.setAttribute(attrName,attrVal);      opt.setAttributeNode(spantemp.attributes[j].cloneNode(true));     }catch(e){}    }   }   //getting styles   if(spantemp.style){    for(var y in spantemp.style){     try{opt.style[y] = spantemp.style[y];}catch(e){}    }   }   //value and text   opt.value = spantemp.getAttribute("value")   opt.text = spantemp.innerHTML   //IE   opt.selected = spantemp.getAttribute('selected');   opt.className = spantemp.className;  }  }     document.body.removeChild(selTemp) selTemp = null}var RatingStarToSend = 0;                               function RatingViewStar(num) {  document.getElementById('star_select').className = "s" + num;}function RatingChangeStarToSend(num) {  RatingStarToSend = num;  RatingWrite('p_id_rate');  document.getElementById('id_rate').options[num].selected = 'selected';}         function RatingWrite(kam) {  var inner = '<option value="" label="- Vyberte -" selected="selected">- Vyberte -</option> <option value="1" label="*">*</option> <option value="2" label="**">**</option> <option value="3" label="***">***</option> <option value="4" label="****">****</option> <option value="5" label="*****">*****</option>';                 if(document.getElementById(kam)) {             document.getElementById(kam).innerHTML  = '<label for="id_rate" class="optional">Hodnoceni:</label>';    document.getElementById(kam).innerHTML += '<select class="hide" name="id_rate" id="id_rate"></select>';     select_innerHTML(document.getElementById("id_rate"),inner);    document.getElementById(kam).innerHTML += '<span class="outter"><span id="star_select" class="s'+RatingStarToSend+'">'                                           +  '  <span onmouseover="RatingViewStar(1);" onmouseout="RatingViewStar(' + RatingStarToSend + ');" onclick="RatingChangeStarToSend(1)"></span>'                                           +  '  <span onmouseover="RatingViewStar(2);" onmouseout="RatingViewStar(' + RatingStarToSend + ');" onclick="RatingChangeStarToSend(2)"></span>'                                           +  '  <span onmouseover="RatingViewStar(3);" onmouseout="RatingViewStar(' + RatingStarToSend + ');" onclick="RatingChangeStarToSend(3)"></span>'                                           +  '  <span onmouseover="RatingViewStar(4);" onmouseout="RatingViewStar(' + RatingStarToSend + ');" onclick="RatingChangeStarToSend(4)"></span>'                                           +  '  <span onmouseover="RatingViewStar(5);" onmouseout="RatingViewStar(' + RatingStarToSend + ');" onclick="RatingChangeStarToSend(5)"></span>'                                           +  '</span></span>';  }      }// Searchfunction SearchClearDefault(txtPole,defaultValue){  if(txtPole.value==defaultValue)    txtPole.value="";}function SearchRestoreDefault(txtPole,defaultValue){  if(txtPole.value=="")   txtPole.value=defaultValue;}// Product Bookmarksvar bookmarkVisible = "bookmark-description";  // pomocna promenna, na zacatku nastavena na id zobrazeny zalozkyfunction viewBookmark(bookmarkToView){  if (document.getElementById) {    document.getElementById('div-' + bookmarkVisible).style.display = "none"; // skryje předchozí polozku    document.getElementById("a-" + bookmarkVisible).className = "";    document.getElementById('div-' + bookmarkToView).style.display = "block"; // zobrazi se nakliknuta polozka    document.getElementById("a-" + bookmarkToView).className = "open";    bookmarkVisible = bookmarkToView; // aktualne zobrazena polozka se ulozi do globalni promenne, aby se pozdeji dala skryt    return true; // V adrese nechame #hash	}	else {  	if(document.stylesheets)      document.stylesheets["bookmark"].disabled = true; // v nekterych browserech (IE 4) vypne styl nezobrazovani, aby se polozky alespon zobrazily    return true; // V adrese nechame #hash     }}function BookmarkLoad() {  viewBookmark(bookmarkVisible);   if(location.hash && (location.hash.length > 1))    viewBookmark(location.hash.substr(1));}// Contact Setting// ---------------function SettingDeliveryAsk() {  if (document.getElementById('custom_delivery').checked == true) {    document.getElementById('fieldset-contactform').style.display = "";  } else {    document.getElementById('fieldset-contactform').style.display = "none";  }}function SettingLoad() {  if (document.getElementById('custom_delivery').checked == true) {    document.getElementById('fieldset-contactform').style.display = "";  } else {    document.getElementById('fieldset-contactform').style.display = "none";  }} /* OnLoadfunction loadBody(controler) {  if(controler == 'show-product') {    //Bookmarks        //Rating    RatingChangeStarToSend(0);  }}*/
