function addtomybox(imageid){
	eval('document.form1.boxabtn.src=\'addtobox.asp?imageid=' + imageid +'\';');				
		switch (document.getElementById("abox1").style.display)
		{
			case "none":
				document.getElementById("abox1").style.display='block';
				document.getElementById("bbox1").style.display='none';				
				break;
			case "block":
				document.getElementById("abox1").style.display='none';
				document.getElementById("bbox1").style.display='block';							
				break;
		}	
	
}
function deltomybox(imageid){
	eval('document.form1.boxdbtn.src=\'deltobox.asp?imageid=' + imageid +'\';');				
		switch (document.getElementById("bbox1").style.display)
		{
			case "none":
				document.getElementById("abox1").style.display='none';
				document.getElementById("bbox1").style.display='block';				
				break;
			case "block":
				document.getElementById("abox1").style.display='block';
				document.getElementById("bbox1").style.display='none';							
				break;
		}	
}


function addtomycart(imageid){
	eval('document.form1.cartabtn.src=\'addtocart.asp?imageid=' + imageid +'\';');				
	switch (document.getElementById("a1").style.display)
	{
		case "none":
			document.getElementById("a1").style.display='block';
			document.getElementById("b1").style.display='none';				
			break;
		case "block":
			document.getElementById("a1").style.display='none';
			document.getElementById("b1").style.display='block';							
			break;
	}	

	var artc=0;
	if (document.getElementById("ditemsincaddie") != null)
	{
		artc = parseInt(document.getElementById("ditemsincaddie").value);		
	}
	
	if (document.getElementById("artincaddie") != null)
	{
		artc = parseInt(document.frmcSearch.artincaddie.value);
		document.getElementById("caddie").style.display='block';
	}	
	
	var lang = document.getElementById("ulang").value;
	var cat = document.getElementById("categoryid").value;
	var gpage = document.getElementById("whichpage").value;
	var bag = document.getElementById("shopbag").value;
	artc=artc+1
		
	
	switch (lang)
	{
			case "F":
				picsintro="contient"
				picstxt="photos"
				pictxt="photo"
				shopcarttxt="Caddie"
				break;
			case "E":
				picsintro="contains"
				picstxt="pics"
				pictxt="pic"
				shopcarttxt="Shopping Cart"
				break;
			case "D":
				picsintro="enthält"
				picstxt="Fotos"
				pictxt="Foto"
				shopcarttxt="Einkaufswagen"
				break;
			default:
				picsintro="contient"
				picstxt="photos"
				pictxt="photo"
				shopcarttxt="Caddie"
				break;

	}
	if (artc==1){picstxt=pictxt}	
	var cadthesevaluestxt="";
	var linkpage = "bag.asp?action=browse&shopbag="+bag+"&categoryid="+cat+"&gpage="+gpage+"&lang="+lang;
	if (document.getElementById("artincaddie") != null)
		{
		document.frmcSearch.artincaddie.value=artc + ' ' + picstxt;
		cadthesevaluestxt = "<div id='modulesleftalign' class='CurrentCategory_s'>" + picsintro + "&nbsp;&nbsp;<a href="+linkpage + ">" + artc + ' ' + picstxt +"</a></div>"
		document.getElementById("caddieitems").innerHTML= cadthesevaluestxt ;
		}
	if (document.getElementById("ditemsincaddie") != null)
		{
		document.getElementById("ditemsincaddie").value=artc + ' ' + picstxt;	
		//cadthesevaluestxt = "<img src=images/caddie.gif border=0 align=absmiddle hspace=3 name=picshoppingcart alt=" + shopcarttxt +"><a href="+linkpage + ">" + picstxt + ' (' + artc + ')'+"</a>"
		//document.getElementById("itemsincaddie").innerHTML= cadthesevaluestxt ;		
		}		
	

}
function deltomycart(imageid){
	eval('document.form1.cartdbtn.src=\'deltocart.asp?imageid=' + imageid +'\';');				
	switch (document.getElementById("b1").style.display)
	{
		case "none":
			document.getElementById("a1").style.display='none';
			document.getElementById("b1").style.display='block';				
			break;
		case "block":
			document.getElementById("a1").style.display='block';
			document.getElementById("b1").style.display='none';							
			break;
	}	

	var artc=0;
	if (document.getElementById("ditemsincaddie") != null)
	{
		artc = parseInt(document.getElementById("ditemsincaddie").value);			
	}
	
	if (document.getElementById("artincaddie") != null)
	{
		artc = parseInt(document.frmcSearch.artincaddie.value);
		document.getElementById("caddie").style.display='block';
	}	
	var lang = document.getElementById("ulang").value;
	var cat = document.getElementById("categoryid").value;
	var gpage = document.getElementById("whichpage").value;
	var bag = document.getElementById("shopbag").value;
	artc=artc-1
	
	
	if (artc<=0)
	{
		artc=0
		switch (lang)
		{
			case "F":
				picsintro="... est vide"
				break;
			case "E":
				picsintro="... is empty"
				break;
			case "D":
				picsintro="... ist leer"
				break;
			default:
				picsintro="... est vide"
				break;
		}
	}
	else
	{
	switch (lang)
	{
			case "F":
				picsintro="contient"
				picstxt="photos"
				pictxt="photo"
				shopcarttxt="Caddie"
				break;
			case "E":
				picsintro="contains"
				picstxt="pics"
				pictxt="pic"
				shopcarttxt="Shopping Cart"
				break;
			case "D":
				picsintro="enthält"
				picstxt="Fotos"
				pictxt="Foto"
				shopcarttxt="Einkaufswagen"
				break;
			default:
				picsintro="contient"
				picstxt="photos"
				pictxt="photo"
				shopcarttxt="Caddie"
				break;
	}
	}
	
	if (artc==1){picstxt=pictxt}	
	var cadthesevaluestxt="";
	var linkpage = "bag.asp?action=browse&shopbag="+bag+"&categoryid="+cat+"&gpage="+gpage+"&lang="+lang;
	if (document.getElementById("artincaddie") != null)
		{
		document.frmcSearch.artincaddie.value=artc + ' ' + picstxt;		
		if (artc==0)
		{
			cadthesevaluestxt = "<div id='modulesleftalign' class='CurrentCategory_s'>" + picsintro + "</div>";
		}
		else
		{
			cadthesevaluestxt = "<div id='modulesleftalign' class='CurrentCategory_s'>" + picsintro + "&nbsp;&nbsp;<a href="+linkpage + ">" + artc + ' ' + picstxt +"</a></div>";
		}
		document.getElementById("caddieitems").innerHTML= cadthesevaluestxt ;
	}
		
	if (document.getElementById("ditemsincaddie") != null)
		document.getElementById("ditemsincaddie").value=artc + ' ' + picstxt;
		if (document.getElementById("itemsincaddie") != null)
		{
			{
			if (artc==0)
			{			
			cadthesevaluestxt = "<img src=images/caddie_out.gif border=0 align=absmiddle hspace=3 name=picshoppingcart alt=" + shopcarttxt +">" + picstxt + ' (' + artc + ')'
			document.getElementById("itemsincaddie").innerHTML= cadthesevaluestxt ;								
			}
			else
			{
			cadthesevaluestxt = "<img src=images/caddie.gif border=0 align=absmiddle hspace=3 name=picshoppingcart alt=" + shopcarttxt +"><a href="+linkpage + ">" + picstxt + ' (' + artc + ')'+"</a>"
			document.getElementById("itemsincaddie").innerHTML= cadthesevaluestxt ;		
			}
		}
	}		
	
	
	
}

function exitpic(categoryid,whichpage,catn) {
	thelang=document.form1.ulang.value;	
	
	self.location.href='gallery.asp?categoryid='+categoryid+'&showtype='+document.form1.showtype.value+'&whichpage='+whichpage+'&catn='+catn;

//self.location.href='gallery.asp?action=viewimage&categoryid='+categoryid+'&imageid='+document.form1.imageid.value+'&showtype='+document.form1.showtype.value+'&whichpage='+whichpage+'&catn='+catn+'&lang='+thelang;
}
function slideshow(imageid,categoryid,sortby,showtype){
	theyear=document.form1.ayear.value;
	themonth=document.form1.amonth.value;
	userid=document.form1.userid.value;
	//thelang=document.form1.ulang.value;

	//document.form1.action='gallery.asp?action=viewimage&slideshow=on&categoryid=' + categoryid + '&imageid=' + imageid + '&sortby=' + sortby +'&showtype=' + showtype + '&userid=' + userid + '&year=' + theyear + '&month=' + themonth + '&whichpage=' + document.form1.whichpage.value + '&lang=' + thelang;
	if (userid == '')
	{
	document.form1.action='gallery.asp?action=viewimage&slideshow=on&categoryid=' + categoryid + '&imageid=' + imageid + '&showtype=' + showtype + '&year=' + theyear + '&month=' + themonth + '&whichpage=' + document.form1.whichpage.value;
	}
	else
	{
	document.form1.action='gallery.asp?action=viewimage&slideshow=on&imageid=' + imageid + '&showtype=' + showtype + '&userid=' + userid + '&whichpage=' + document.form1.whichpage.value;	
	}
	
	document.form1.submit();	
}

function stopslideshow(){
	window.clearTimeout(timer1)
	document.form1.slideshow.value='';
	document.form1.slideshowon.style.display='inline';		
	document.form1.slideshowoff.style.display='none';
	document.getElementById("nextprevdiv").style.display='';
	document.getElementById("stopslideshowdiv").style.display='none';
	document.getElementById("slideshowmode").style.display='none';	
	document.getElementById("startslideshowdiv").style.display='inline';
	document.getElementById("startslideshowbackdiv").style.display='';
}

function datechanged(){
	var sel_idx_year = document.form1.yearc.selectedIndex;
	var sel_idx_month = document.form1.monthc.selectedIndex;
	var yearval = document.form1.yearc.options[sel_idx_year].value;
	var monthval = document.form1.monthc.options[sel_idx_month].value;
	document.form1.action='gallery.asp?action=mostpop&showtype=mp&year=' + yearval + '&month=' + monthval + '&sortby=2';			
	document.form1.submit();		
}

function ratefile(imageid){
	var	rating=window.open('rateimage.asp?imageid=' + imageid ,'rating','toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=1,width=320,height=280');
	rating.focus();
}

function rateevent(categoryid){
	var	rating=window.open('rateevent.asp?categoryid=' + categoryid,'rating','toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=1,width=340,height=300');
	rating.focus();
}


function reviewfile(imageid){
	var	review=window.open('reviewimage.asp?imageid=' + imageid,'review','toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=0,width=400,height=390');
	review.focus();
}

function clearmybox(){
if (confirm('Clear Your Favorite Files?')) self.location.href='gallery.asp?action=mybox&clear=1';
}

function openmybox(){
	var openmybox=window.open('mybox.asp'  ,'openmybox','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width=400,height=300');
	openmybox.focus();
}

function sendpostcard(imageid){
	var	postcard=window.open('sendpostcard.asp?imageid=' + imageid ,'postcard','toolbar=0,directories=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1000,height=760');
	postcard.focus();
}

function showsurveyresult(whichpoll,howmanyreplies,language){
	var newheight=Number(howmanyreplies);
	newheight=(newheight*40)+120;
	var	surveywnd=window.open('vote.asp?showresult=true&pollid=' + whichpoll +'&lang=' + language,'poll','toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=0,width=600,height='+newheight+'');
	surveywnd.focus();
}

function votesurvey(whichpoll,howmanyreplies,language){
	var newheight=Number(howmanyreplies);
	newheight=(newheight*50)+120;
	var m=0;
	for (i=0;i<Number(howmanyreplies);i++) {
		if (document.forms.poll.choix[i].checked==true) { 
		m=i; 			
		break;
		}
	}												
	var	surveywnd=window.open('vote.asp?choix='+Number(i+1) +'&pollid=' + whichpoll +'&lang=' + language + '&valid=true' + '&Submit1=vote' ,'survey','toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=0,width=600,height='+newheight+'');	
	surveywnd.focus();
}



 
