// JavaScript Document

 //MultiVars
 
				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.indexOf("<option")<0){//se n�o � option eu converto
								innerHTML = "<option>" + innerHTML + "</option>"
							}
							innerHTML = innerHTML.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
						}
function fax_order_open()
{
	
    var _cfg = "status=yes,scrollbars=yes,menubar=no,width=850,height=800,resizable=yes";
    window.open("?cl=sc_fax_order", "_blank", _cfg);
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

	/*$(document).ready(function () {
	$("a[rel^='prettyPhoto']").prettyPhoto({"theme":"light_rounded","opacity":0.1});
	
	///////////////////////////checkout footer

	var re = /https\:\/\/ssl\.japanwelt\.de\/out\/jw\/img\/(.*?)_gray\.jpg/i;
	$(".co_method").click(function () {
		//Alle auf gray	
		m = document.getElementsByClassName("co_method");
		for(i in m)
		{
			m[i].children[0].src = "https://ssl.japanwelt.de/out/jw/img/" + m[i].children[0].id + "_gray.jpg";
		}
		$(this).children().attr("src","https://ssl.japanwelt.de/out/jw/img/" + $(this).children().attr("id") + ".jpg");
	});

});	*/
	
	
//futon search

function suggest(sKey)
{
	var ajax = new Ajax();
	
	ajax.action = "";
	ajax.method = "get";
	
	ajax.createFormArray({"cl" : "sxsuggest","q" : sKey});
	
	ajax.onready = suggestReady;
	ajax.onerror = function () {};
	
	ajax.run();
}

function suggestReady() { 
 document.getElementById("ausgabe").innerHTML=this.response;

}

function suggestClose (div_value) {
	document.getElementById('searchsuggest').innerHTML = '';
	document.getElementById('searchsuggest').style.display = 'none';
}

function clickFirstZoomPic()
{
	$($(".lightbox")[0]).click();
}

// details tabs

function showTab(sID)
{
	//TabContents
	$(".scTabContent").hide();
	$("#"+sID).show();
	//Tab Headers
	$(".detail_desc_reiter").removeClass("hover");
	$(".detail_desc_reiter").addClass("off");
	
	sTabId = sID + "_reiter";
	$("#"+sTabId).removeClass("off");
	$("#"+sTabId).addClass("hover");
}
