function open_win(img,w,h){
   text_link= "width="+w+",height="+h+",scrollbars=yes,toolbar=no,menubar=no,status=no,location=no,top=0,left=0,resizable=yes"
   window.open(img,'img',text_link);
}

function open_win_size(img,w,h){
  img=img + document.shopForm.painting_size.selectedIndex + '.jpg';
  text_link= "width="+w+",height="+h+",scrollbars=yes,toolbar=no,menubar=no,status=no,location=no,top=0,left=0,resizable=yes"
  window.open(img,'img',text_link);
}
function open_win_newbg() {
	splitvalueSelect=document.shopForm.painting_style.value.split("#");	
	imedium = splitvalueSelect[0];
	if ((imedium == 5) || (imedium == 10) || (imedium == 11) ) {
		alert('Voor houtskool en potlood portretten staat alleen een witte achtergrond ter beschikking.');
	}
	else {
		surl1 = 'select_background_new.asp?m='+ imedium;
		open_win(surl1,810,768);
	}
}

function open_win_new() {
	var sframes = '';
	splitvalueSelect=document.shopForm.painting_style.value.split("#");
	for (i=0; i<document.shopForm.packing_method.options.length; i++)
	{
//		alert(document.shopForm.packing_method.options[i].value);
		if (i==0) {
			sframes = document.shopForm.packing_method.options[i].value;
		}
		else {
			sframes = sframes + ',' + document.shopForm.packing_method.options[i].value;
		}
	}
//	alert(sframes);
	open_win('frame_tube_gallerywrap_new1.asp?selectopt=yes&f='+sframes,1080,768);
}
function open_win_new1() {
	splitvalueSelect=document.shopForm.painting_style.value.split("#");
	if (splitvalueSelect[0] == 12) {
		open_win('mosaic-from-photo.asp',1024,768);
	} 
	else {
		open_win('images/frame-tube-gallerywrap.jpg',1024,768);
	}
}

function changepaintingtype(formobj) {
	fncShowHideBoxComment(document.shopForm.painting_type.selectedIndex);
	if (document.shopForm.painting_type.selectedIndex == 3) {
		document.shopForm.painting_subjects_type.selectedIndex = 0;
		document.shopForm.painting_subjects_type.disabled = true; 
	}
	else {
		document.shopForm.painting_subjects_type.disabled = false; 
	}
}

function open_win_figures() {
		open_win('type-and-figures-examples.asp',1000,370);
}
function Form_Validator1() {
	Form_Validator(document.shopForm);
}

function Form_Validator1() {
	Form_Validator(document.shopForm);
}

function Form_Validator(theForm)
{

 if (theForm.send_type.value == "")
  {
    alert("Please Select the 'way you would like to send your photos'");
    theForm.send_type.focus();
    return (false);
  } 
 
 //alert(theForm.painting_type.value);
 //alert(theForm.painting_style.value);
 //alert(theForm.packing_method.value);
  
 if (theForm.painting_style.value!="1#1.0" && theForm.painting_style.value!="9#1.1")
 {
 	if(theForm.packing_method.value=="gallery_wrap")
	{
		alert("Please Select other Framing option");
		return (false);
	}
 }
	
 if (theForm.painting_type.value == "Select#0")
  {
    alert("Please Select the Painting Type");
    theForm.painting_type.focus();
    return (false);
  }
  if (theForm.painting_background.value == "0")
  {
    alert("Please Select the background of your painting");
    theForm.painting_background.focus();
    return (false);
  }
   
  if (theForm.packing_method.value == "0")
  {
    alert("Please Select whether you would like to have your painting framed or not.");
    theForm.packing_method.focus();
    return (false);
  } 
  
  	document.shopForm.painting_subjects_type.disabled = false; 
	theForm.submit();
  	return (true);

 }

