// JavaScript ss11 functions
var mainWidth=333; var mainHeight=500;
function showimages(name,style)
{
/**/
document.getElementById("mainimage2").style.visibility='hidden'; //hide rolling images
document.getElementById("mainimage").innerHTML='<img src="../images/ss11/'+name+'_main.jpg" width="'+mainWidth+'" height="'+mainHeight+'" alt="&nbsp;"  />';
document.getElementById("topopeninginfo").style.visibility='hidden';
document.getElementById("imagetopleft").innerHTML='<img src="../images/ss11/'+name+'_detail_main.jpg" width="118" height="162"  alt="&nbsp;"  onMouseover="mainImageSwopInBack(\''+name+'\')" onMouseout="mainImageSwopIn(\''+name+'\')" />';
document.getElementById("imagetopright").innerHTML='<img src="../images/ss11/'+name+'_back_main.jpg" width="118" height="162"  alt="&nbsp;"   onMouseover="mainImageSwopInDetail(\''+name+'\')" onMouseout="mainImageSwopIn(\''+name+'\')"/>';
document.getElementById("imagetopleft").style.visibility='visible';
document.getElementById("imagetopright").style.visibility='visible';
document.getElementById('smallimageinfo').innerHTML='move mouse over image to enlarge';

getProductInfoAjax('SS11',style)

}

function mainImageSwopInBack(name)
{
document.getElementById("mainimage").innerHTML='<img src="../images/ss11/'+name+'_detail_main.jpg" width="'+mainWidth+'" height="'+mainHeight+'" alt="&nbsp;" />';
}

function mainImageSwopInFront(name)
{
document.getElementById("mainimage").innerHTML='<img src="../images/ss11/'+name+'_front_main.jpg" width="'+mainWidth+'" height="'+mainHeight+'"  alt="&nbsp;" />';
}

function mainImageSwopInDetail(name)
{
document.getElementById("mainimage").innerHTML='<img src="../images/ss11/'+name+'_back_main.jpg" width="'+mainWidth+'" height="'+mainHeight+'" alt="&nbsp;" />';
}

function mainImageSwopIn(name)
{
document.getElementById("mainimage").innerHTML='<img src="../images/ss11/'+name+'_main.jpg" width="'+mainWidth+'" height="'+mainHeight+'" alt="&nbsp;" />';
}


function getProductInfoAjax(collection,style)
{
xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
  	{
  	alert ("Your browser does not support XMLHTTP!");
  	return;
  	} 
var url="ajax_productinfoss11.php"; // set for database table
url=url+"?c="+collection+"&s="+style;
url=url+"&sid="+Math.random();
//document.getElementById("layerurl").innerHTML=url;
xmlhttp.onreadystatechange=collectionStateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
 }
 
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function collectionStateChanged()
{
if (xmlhttp.readyState==4)
  {
 var infoLine=xmlhttp.responseText;
   		
		document.getElementById("imagetext").innerHTML=infoLine;
		
		// extract colour info and show swatches
		/* not used for ss11
		var colourarray = Array('Sky blue w/pink','Shell flamingo w/black','Plain shell w/black','Black stripes.','Liquorice.','Pacific.','Lagoon flamingo  w/pink','Shell flamingo w/blue','Pacific w/contrast pink','Watermelon w/contrast blue','Confetti.','Watermelon.','Lagoon flamingo','Shell flamingo');
		var swatcharray = Array('swatch_Sky blue w/pink','swatch_Shell flamingo w/black','swatch_Plain shell w/black','swatch_Black stripes','swatch_Liquorice','swatch_Pacific','swatch_Lagoon flamingo  w/pink','swatch_Shell flamingo w/blue','swatch_Pacific w/contrast pink','swatch_Watermelon w/contrast blue','Confetti','swatch_Watermelon','swatch_Lagoon flamingo','swatch_Shell flamingo');
		var textarray = Array('Sky blue w/pink','Shell flamingo w/black','Plain shell w/black','Black stripes','Liquorice','Pacific','Lagoon flamingo  w/pink','Shell flamingo w/blue','Pacific w/contrast pink','Watermelon w/contrast blue','Confetti','Watermelon','Lagoon flamingo','Shell flamingo')
		//document.getElementById("colourinfo").innerHTML='TESTING';
		var special='Alfie';
		colours='';
		for(i=0;i<14;i++)
		{
		if (infoLine.search(colourarray[i])>10 ) {colours=colours+
		'<img src="../images/ss11/'+swatcharray[i]+'.jpg" width="80" height="100" alt="'+textarray[i]+'" title="'+textarray[i]+'" />&nbsp;';}
		}
		document.getElementById("colourinfo").innerHTML=colours;
  */

	}
}
