function openWin(design,img,title,ht) {
  var winHt = ht;
  winId = window.open('','newwin','width=380,height='+winHt);
  winId.document.write('<html>');
  winId.document.write('<head>');
  winId.document.write('<title>'+design+' - '+title+'</title>');
  winId.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
  winId.document.write('<link href="fgstyles0905.css" rel="stylesheet" type="text/css">');
  winId.document.write('</head>');

  winId.document.write('<body onLoad="if (window.focus) window.focus()" leftmargin="10" rightmargin="10" topmargin="10" bottommargin="10">');

  winId.document.write('<table border="0" cellpadding="0" cellspacing="0" width="360" height="130" class="box"> ');
  winId.document.write(' <tr><td width="240">&nbsp;</td><td colspan="1" height="20" class="page">'+design+'</td></tr>');
  winId.document.write(' <tr>');
  winId.document.write('  <td valign="top" colspan="2">');
  winId.document.write('   <table border="0" cellpadding="0" cellspacing="0">');
  winId.document.write('    <tr>');
  winId.document.write('	 <td class="vspace">&nbsp;</td>');
  winId.document.write('	 <td><h1>'+title+'</h1></td>');
  winId.document.write('	 <td class="vspace">&nbsp;</td>');
  winId.document.write('	</tr>');
  winId.document.write('    <tr><td>&nbsp;</td></tr>');
  winId.document.write('    <tr>');
  winId.document.write('	 <td class="vspace">&nbsp;</td>');
  winId.document.write('	 <td><img id="largeImg" border="0" src="' + img + '" alt="'+design+'"></td>');
  winId.document.write('	 <td class="vspace">&nbsp;</td>');
  winId.document.write('	</tr>');	
  winId.document.write('    <tr><td class="hspace" colspan="3">&nbsp;</td></tr>');
  winId.document.write('   </table>');
  winId.document.write('  </td>');
  winId.document.write(' </tr>');
  winId.document.write('</table>');
  winId.document.write('</body>');
  winId.document.write('</html>');
  
  winId.document.close();
}

function viewImage(mainImgFile){
	var designDetsId = document.getElementById( 'designdetails' );
	var buyId = document.getElementById( 'buy' );
	if (designDetsId.style.display == "block")
	{
	 designDetsId.style.display = "";
	 buyId.style.display = "block";	 
 	 document.images['enlargeimg'].src = 'images/enlarge.gif';
	}
	document.images['mainimg'].src = mainImgFile;
	//document.tcolform.tcol.options.value=mainImgFile;
}

function viewImage2(gender,design){
	var colVal = document.tcolform.tcol.options[document.tcolform.tcol.selectedIndex].value;
	//alert(colVal);

    //if (colVal) == 'Royal Blue' { colVal = 'Royal'; }
	//if (colVal=='0') {
	    //alert("please select a colour");
    //} else {images/mens/zinchopetshirt.jpg
	  viewImage("images/"+gender+"/"+colVal+design+"tshirt.jpg");
	//}
	
//	document.images['mainimg'].src = mainImgFile;
}

function showDetail() {

   var wWidth = document.body.offsetWidth;
   var ypos = wWidth/2;
   //alert(wWidth);
   if ( document.getElementById ) {
	var designDetsId = document.getElementById( 'designdetails' );
	var buyId = document.getElementById( 'buy' );	
    if ( designDetsId.style.display == "block" ) {
     designDetsId.style.display = "none";
     buyId.style.display = "block";
	 document.images['enlargeimg'].src = 'images/enlarge.gif';
//	document.tcolform.os0.style.display="block";
//	document.tcolform.os1.style.display="block";
    } else {

	with( designDetsId.style ) {
	display = "block";
	position = "absolute";
	//top = 300+ 'px';
//	document.tcolform.os0.style.display="none";
//	document.tcolform.os1.style.display="none";
     buyId.style.display = "none";
	 document.images['enlargeimg'].src = 'images/enlarge2.gif';
	}

     //document.getElementById( 'frameborder' ).style.top = 265;
     //document.getElementById( 'frameborder' ).style.left = wWidth/2+30;	 
	 //designDetsId.style.visibility = 'visible';
    }
   }	
}
