// JavaScript Document

function show( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


$(document).ready(function() 
{		

	$('#sizehelp').live('click',function()
	{ 
	
	$('#PopupSizeHelp').dialog('open'); return false

	


	 	return false //return false to prevent the link from working
	 });
		
  	$('#stockhelp').live('click',function()
	{ 
	
	$('#PopupStockHelp').dialog('open'); return false

	


	 	return false //return false to prevent the link from working
	 });

	$('#AJAX-Shop a').live('click',function() 
	{
			//alert ("Oh... That works, You Selected:");
			var ref = $(this).attr("ref"); //get the ref from the title attribute of the link
			var cid = $(this).attr("cid"); //get the colour id from the title attribute of the link
			var sid = $(this).attr("sid"); //get the size id from the title attribute of the link
			var wid = $(this).attr("wid"); //get the width id from the title attribute of the link
		    $.ajax( //ajax request starting
			{
		       url: "/uk/Ajax/1/?ref="+ref+"&cid="+cid+"&sid="+sid+"&wid="+wid, //send the ajax request 
                       type:"GET",//request is a POSt request
		       
		       success: function(html){ $("#AJAX-Shop").html(html); 
			  
			 }

		    });
		
  		return false //return false to prevent the link from working
	}); 
	
	});	

