
function submitform()
{
  document.myform.submit();
}


function open_gallery(name,whichshowcase)
{
	   
        var width=screen.availWidth;  
        var height=screen.availHeight;  
        var newWin="resize=yes,scrollbars=no,width=578,height=400,status=yes,top=" + (height-500)/2 + ",left=" + (width-800)/2;  
        //window.resizeTo(width,height);  
        var otherwindow = window.open(name,'NewWin',newWin);  

        otherwindow.creator = self;
        if(otherwindow.open)      
        {
                otherwindow.focus();
        }  
}

function open_hebrew(name,whichshowcase)
{
	   
        var width=screen.availWidth;  
        var height=screen.availHeight;  
        var newWin="scrollbars=yes,width=400,height=600,status=no,top=" + (height-500)/2 + ",left=" + (width-800)/2;  
        //window.resizeTo(width,height);  
        var hebrewwindow = window.open(name,'NewWin',newWin);  

        hebrewwindow.creator = self;
        if(hebrewwindow.open)      
        {
                hebrewwindow.focus();
        }  
}

function open_pay(name,whichshowcase)
{
	   
        var width=screen.availWidth;  
        var height=screen.availHeight;  
        var newWin="scrollbars=yes,width=800,height=600,status=yes,top=" + (height-500)/2 + ",left=" + (width-800)/2;  
        //window.resizeTo(width,height);  
        var paywindow = window.open(name,'NewWin',newWin);  

        //paywindow.creator = self;
        if(paywindow.open)      
        {
                paywindow.focus();
        }  
}

function browse2(current,direction)
{
	var currentindex;
	var x;
	var showcase = new Array (
   ["gallery_001"],
   ["gallery_002"],
   ["gallery_003"],
   ["gallery_004"],
   ["gallery_005"],
   ["gallery_006"],
   ["gallery_007"],
   ["gallery_008"],
   ["gallery_009"],
   ["gallery_011"],
   ["gallery_010"]
	);
	
	for (x in showcase)
	{
		if(showcase[x] == current)
		{
			if(direction == 'back' && x==0)
				{return(showcase[showcase.length-1]+'.php');}
			else if(direction == 'back')
				{return(showcase[x-1]+'.php');}
			if	(direction == 'next' && x==showcase.length-1)
				{return(showcase[0]+'.php');}
			else if(direction == 'next')
				{return(showcase[++x]+'.php');}
		}
	}
}


function browse(current,direction,whichshowcase)
{
	var currentindex;
	var x;
	var usethis;
	var showcase = new Array (
   ["gallery_001"],
   ["gallery_002"],
   ["gallery_003"],
   ["gallery_004"],
   ["gallery_005"],
   ["gallery_006"],
   ["gallery_007"],
   ["gallery_008"],
   ["gallery_009"],
   ["gallery_011"],
   ["gallery_010"],
   ["gallery_018"],
   ["gallery_019"],
   ["gallery_020"],
   ["gallery_021"],
   ["gallery_022"],
   ["gallery_023"],
   ["gallery_024"],
   ["gallery_030"],
   ["gallery_026"],
   ["gallery_027"],
   ["gallery_028"],
   ["gallery_029"]
	);
	
	var showcase2 = new Array (
   ["gallery_007"],
   ["gallery_010"],
   ["gallery_011"],
   ["gallery_012"],
   ["gallery_013"],
   ["gallery_014"],
   ["gallery_015"],
   ["gallery_016"]
	);
	
	var showcase3 = new Array (
   ["gallery_008"],
   ["gallery_001"],
   ["gallery_002"],
   ["gallery_003"],
   ["gallery_004"],
   ["gallery_005"],
   ["gallery_006"],
   ["gallery_009"]
	);
	
	var showcase4 = new Array (
   ["gallery_007"],
   ["gallery_010"],
   ["gallery_011"],
   ["gallery_012"],
   ["gallery_013"],
   ["gallery_014"],
   ["gallery_015"],
   ["gallery_016"]
	);
	
	
	
	if(whichshowcase=='showcase')
		{usethis=showcase;}
	if(whichshowcase=='showcase2')
		{usethis=showcase2;}
	if(whichshowcase=='showcase3')
		{usethis=showcase3;}
	if(whichshowcase=='showcase4')
		{usethis=showcase4;}
	
	for (x in usethis)
	{
		if(usethis[x] == current)
		{
			if(direction == 'back' && x==0)
				{
					//alert(usethis[usethis.length-1]+'.php?whichshowcase='+whichshowcase);
					return(usethis[usethis.length-1]+'.php?whichshowcase='+whichshowcase);
				}
			else if(direction == 'back')
				{
					//alert(usethis[x-1]+'.php?whichshowcase='+whichshowcase);
					return(usethis[x-1]+'.php?whichshowcase='+whichshowcase);
				}
			if	(direction == 'next' && x==usethis.length-1)
				{return(usethis[0]+'.php?whichshowcase='+whichshowcase);}
			else if(direction == 'next')
				{return(usethis[++x]+'.php?whichshowcase='+whichshowcase);}
		}
	}
	
	
	/*if(whichshowcase=='showcase2')
	{
	for (x in showcase2)
	{
		if(showcase2[x] == current)
		{
			if(direction == 'back' && x==0)
				{return(showcase2[showcase2.length-1]+'.php?whichshowcase='+whichshowcase);}
			else if(direction == 'back')
				{return(showcase2[x-1]+'.php?whichshowcase='+whichshowcase);}
			if	(direction == 'next' && x==showcase2.length-1)
				{return(showcase2[0]+'.php?whichshowcase='+whichshowcase);}
			else if(direction == 'next')
				{return(showcase2[++x]+'.php?whichshowcase='+whichshowcase);}
		}
	}
	}*/
}