function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showLayer (layer1)  {
	var obj = MM_findObj(layer1);
	obj.style.visibility = 'visible';
	obj.style.display = '';
}

function hideLayer (layer1)  {
	var obj = MM_findObj(layer1);
	obj.style.visibility = 'hidden';
	obj.style.display = 'none';
}

function showLayerImage (layer1,strimage)  {
	var obj = MM_findObj(layer1);
	obj.style.visibility = 'visible';
	obj.style.display = '';
	obj.style.background = "url("+strimage+")";
}


function SwopNewsFeed(objID,objCntr){
	for(i=1;i<objCntr+1;i++){
		var obj = MM_findObj('rssfeed'+i);
		var objButton = MM_findObj('rssfeedTab'+i); 
		if (objID==i){
			obj.style.visibility = 'visible';
			obj.style.display = '';	
			
			if(i<3){
				objButton.className = 'TabTopOn';
			}else{
				objButton.className = 'TabBottomOn';
			}
		}else{
			obj.style.visibility = 'hidden';
			obj.style.display = 'none';		
			if(i<3){
				objButton.className = 'TabTopOff';
			}else{
				objButton.className = 'TabBottomOff';	
			}		
		}
	}
}
function SwopNews(objID,objCntr)
{
	for(i=0;i<objCntr;i++)
	{
		var obj = MM_findObj('MainNews'+i);
		var objButton = MM_findObj('MainNewsButton'+i);
		if (objID==i)
		{
			obj.style.visibility = 'visible';
			obj.style.display = '';	
			objButton.className = 'ButtonOn';
			objButton.onmouseover = "javascript:className='ButtonOn';"
			objButton.onmouseout = "javascript:className='ButtonOn';"
			
		}
		else
		{
			obj.style.visibility = 'hidden';
			obj.style.display = 'none';			
			objButton.className = 'ButtonOff';	
			objButton.onmouseover = "javascript:className='ButtonOn';"
			objButton.onmouseout = "javascript:className='ButtonOff';"			
		}
		//onMouseOver=""javascript:className='ButtonOn';"" onMouseOut=""javascript:className='ButtonOff'
	}
}

function doSearchVal(obj)
{
	if(obj.searchbox.value.length < 3)
	{
		alert('Please enter at least three characters.');
		obj.searchbox.focus();
		return false;
	}
	return true;	
}

function load_file_doc()
{
	// this function does absolutely nothing ... hehe
}

function realy_load_file_doc(varFileName)
{
	// this one does the actual loading ...
	window.open('Uploads/'+String(varFileName), '_blank');
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}


function DynLyr() 
{
	var i,p,v,obj,args=DynLyr.arguments;
	
	for (i=0; i<(args.length-2); i+=3)
	{
  		if ((obj=MM_findObj(args[i]))!=null) 
		{ 
			v=args[i+2];
			
			if (obj.style) 
			{ 
				obj=obj.style;
				
				if (v=='show')
				{
					obj.display="";
					obj.visibility="visible"; 
				}
				else
				{
					obj.display="none";	
					obj.visibility="hidden"; 
				} 
			}
		}
	}
}

function ChkLyr(varDiv, varMainDiv, varLevel)
{
	var obj 	= MM_findObj(varDiv);
	var MainObj = MM_findObj(varMainDiv);
	
	if (obj != null) 
	{ 
		if (obj.style.visibility == "visible")
		{
			obj.style.display="none";	
			obj.style.visibility="hidden";
		}
		else
		{
			obj.style.display="";	
			obj.style.visibility="visible"; 
		}
	}
}
function goCreateAnchor(objImage)
{
	var anchor1 = document.getElementById('tempa');
	var imagesrc = objImage.src.replace('_cmsthumbclick','');
	anchor1.setAttribute('href',imagesrc);
	anchor1.setAttribute('rel','contentimage');	
	anchor1.setAttribute('title',objImage.alt);	
	myLightbox.start(anchor1); 
	return false;	
}





function doValidateShop(objForm)
{
	objForm.SubmitRegister.disabled = true;

	if (objForm.CustName.value == '')
		{
			alert("A valid Name is required.");
			objForm.SubmitRegister.disabled = false;			
			objForm.CustName.focus();				
			return false;
		}

	if (objForm.CustSurname.value == '')
		{
			alert("A valid Surname is required.");
			objForm.SubmitRegister.disabled = false;			
			objForm.CustSurname.focus();				
			return false;
		}
		

	if (objForm.CustContact.value == '')
	{
		alert("A valid Contact Number is required.");
		objForm.SubmitRegister.disabled = false;		
		objForm.CustContact.focus();				
		return false;
	}	
		
	if ((objForm.CustEmail.value.indexOf("@") == -1) || (objForm.CustEmail.value.indexOf(".") == -1) )
	{
		alert("A valid Email Address is required.");
		objForm.SubmitRegister.disabled = false;		
		objForm.CustEmail.focus();				
		return false;
	}
		

	if (objForm.CustTown.value == '')
	{
		alert("A valid Town/City is required.");
		objForm.SubmitRegister.disabled = false;		
		return false;
	}	

	if (objForm.CustAddress1.value == '')
	{
		alert("A valid Address is required.");
		objForm.SubmitRegister.disabled = false;		
		objForm.CustAddress1.focus();				
		return false;
	}

	if (objForm.CustCode.value == '')
	{
		alert("A valid Post Code is required.");
		objForm.SubmitRegister.disabled = false;		
		objForm.CustCode.focus();				
		return false;
	}
								
		
	


	
	if (objForm.chkTermCond.checked == false)
		{
			alert("Please confirm that you have read and understood our terms and conditions.");
			objForm.SubmitRegister.disabled = false;
			objForm.chkTermCond.focus();				
			return false;
		}
	
	return true;
}	


function sizeLayer (layer1) {

var obj = MM_findObj(layer1);
var PageHeight = document.body.scrollHeight;
var PageWidth = document.body.clientWidth;
	obj.style.height = PageHeight;
	obj.style.width = PageWidth;
var obj = MM_findObj('VideoTable');
	obj.style.left = ((PageWidth-450)/2);
	obj.style.top = 190;
}

function showLayer (layer1,layer2,url,target)  {
	var obj1 = MM_findObj(layer1);
	var obj2 = MM_findObj(layer2);
	obj1.style.visibility = 'visible';
	obj1.style.display = '';
	obj2.style.visibility = 'visible';
	obj2.style.display = '';
	if(url!=""){
		window.open(url,target);
	}
	
}

function hideLayer (layer1,layer2,target)  {
	var obj1 = MM_findObj(layer1);
	var obj2 = MM_findObj(layer2);
	obj1.style.visibility = 'hidden';
	obj1.style.display = 'none';
	obj2.style.visibility = 'hidden';
	obj2.style.display = 'none';
	window.open('blank.html',target);
}
function OpenWindow(url,target){
	window.open(url,'bogus');
}