var dirTpl="gfx/vorlagen/";
var mButs="gfx/shop_part/";

function delayed(path) {window.location.href=path;}

function chgTpl(num, clr) {var colornum="color"+num;document.vorlagen.elements[colornum].value=clr;path=dirTpl+"klein/"+num+"_"+clr+".jpg";document.images['vorlage'+num].src=path;}

function mouseCS(nam, stat) {namlength=nam.length-1;snam=nam.substring(0,namlength);path=mButs+"but_"+snam+stat+".gif";document.images[nam].src=path;}

function openWin(content,name,width,height,left,top,bars) {if(bars=="all") bars = ",location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes"; if(bars=="none") bars = ""; window.open(content,name,'width='+width+',height='+height+',left='+left+',top='+top+','+bars+'');}

function highlightmetasearch() { document.banner.copytext.select(); document.banner.copytext.focus(); }

function copymetasearch() { highlightmetasearch(); textRange = document.banner.copytext.createTextRange(); textRange.execCommand("RemoveFormat"); textRange.execCommand("Copy"); } 

function chgWin(width, height, posx, posy) { window.moveTo(posx, posy); window.resizeTo(width, height); }

function delItm(num) {
var delstr = "del"+num;
var delthis = document.order.elements[delstr].value;
var camefrom = document.thispage.from.value;
camefrom = camefrom.replace("&",":");
link='basket.php?';
if(document.order.pid.value!="") link+='pid='+document.order.pid.value+'&';
link+='refered='+camefrom;
link+='&del='+delthis;
document.location.href=link;
}

function addArt(num, cat, curpg, order, sort, type, pid) {
var colornum="color"+num;
if(document.vorlagen.elements[colornum].value==""){setcolor="";}
else{setcolor=document.vorlagen.elements[colornum].value;}
if(type) page=document.vorlagen.from.value;
else page=document.thispage.from.value;
page=page.substring(0,page.indexOf("?"));
link='basket.php?page='+page;
if(cat) link+='&kat='+cat;
if(curpg) link+='&curpg='+curpg;
if(order) link+='&order='+order;
if(sort) link+='&sort='+sort;
if(pid) link+='&pid='+pid;
link+='&add='+num+':'+setcolor;
if(type) {
 opener.location.href=link;
 window.self.close();
}
else document.location.href=link;
}

function shwTpl(num, clr, pid, type) {
var from = document.thispage.from.value;
self.name='main';
if(clr) {
 shwcolor=clr;
} else {
 var colornum="color"+num;
 if(document.vorlagen.elements[colornum].value==""){shwcolor="";}
 else{shwcolor=document.vorlagen.elements[colornum].value;}
}
link='http://www.hot-templates.net/showtpl.php?tpl='+num+'&clr='+shwcolor+'&from='+from;
if(pid) link+='&pid='+pid;
if(type) link+='&type='+type;
openWin(link,'','720','386','80','80','none');
}

function dshwTpl(num, clr, pid, type) {
var from = document.thispage.from.value;
self.name='main';
if(clr) {
 shwcolor=clr;
} else {
 var colornum="color"+num;
 if(document.vorlagen.elements[colornum].value==""){shwcolor="";}
 else{shwcolor=document.vorlagen.elements[colornum].value;}
}
link='http://www.hot-templates.net/designer/showtpl.php?tpl='+num+'&clr='+shwcolor+'&from='+from;
if(type) link+='&type='+type;
openWin(link,'','720','386','80','80','none');
}

function shwFlash() {
var fheight=document.vorlagen.height.value;
var fwidth=document.vorlagen.width.value;
var height=fheight*1+60;
var width=fwidth*1+40;
var num=document.vorlagen.num.value;
var colornum="color"+num;
if(document.vorlagen.elements[colornum].value==""){shwcolor="";}
else{shwcolor=document.vorlagen.elements[colornum].value;}
openWin('http://www.hot-templates.net/showflash.php?tpl='+num+'&clr='+shwcolor,'',width,height,'50','50','none');
}

function shwDetail() {
var from = document.vorlagen.from.value;
var num = document.vorlagen.num.value;
var colornum = "color"+num;
var type = document.vorlagen.type.value;
if(document.vorlagen.elements[colornum].value==""){shwcolor="";}
else{shwcolor=document.vorlagen.elements[colornum].value;}
var link = 'showtpl.php?tpl='+num+'&clr='+shwcolor+'&full=true&from='+from;
if(type!="") link+='&type='+type;
chgWin('1010','662','7','7');
document.location.href=link;
}

function dshwDetail(thisclr) {
var num = document.vorlagen.num.value;
var type = document.vorlagen.type.value;
if(type!="") {
 var colornum = "color"+num+thisclr;
} else {
 var from = document.vorlagen.from.value;
 var colornum = "color"+num;
}
if(document.vorlagen.elements[colornum].value==""){shwcolor="";}
else{shwcolor=document.vorlagen.elements[colornum].value;}
var link = 'http://www.hot-templates.net/designer/showtpl.php?tpl='+num+'&clr='+shwcolor+'&full=true&from='+from;
if(type!="") {
 link+='&type='+type;
 openWin(link,'','1000','650','7','7','none');
} else {
 chgWin('1010','662','7','7');
 document.location.href=link;
}
}

function shwBkt() {
openWin('basket.php','','480','620','80','80','scrollbars=yes');
}

function shwDft(num) {
openWin('http://www.hot-templates.net/showdraft.php?id='+num,'','580','320','80','80','scrollbars=yes');
}

function shwBook(num) {
openWin('books.php?id='+num,'miep','550','400','80','80','scrollbars=yes');
}

function calServ() {
openWin('service_calc.php','miep','395','515','80','80','scrollbars=auto');
}