// This file contains all the common functions associated with the site
// code, design & hosting by http://qwertywh.net


var agt=navigator.userAgent.toLowerCase();
var is_gecko = (agt.indexOf('gecko') != -1);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie5up = (is_ie)// && !is_ie3 && !is_ie4);

  

function bNavTo(dest,path) {

if (is_gecko)
{
   
    var frames = window.frames; 
	for (var i = 0; i < frames.length; i++) 
	{ 
		if (frames[i].name==dest)
			{
				frames[i].location = path 
				return;
			}
	}
	
    var frames3 = window.parent.frames; 
	for (var i2 = 0; i2 < frames3.length; i2++) 
	{ 
		if (frames3[i2].name==dest)
			{
				frames3[i2].location = path 
				return;
			}
	}
	
/*    var frames = window.parent.frames; 
	for (var i = 0; i < frames.length; i++) 
	{ 
		if (frames[i].name==dest)
			{
				frames[i].location = path 
				return;
			}
	}
*/	
	
	
}
else if (is_ie5up)
{
   //alert('ie5up');
    frames = document.frames;
	for (i = 0; i < frames.length; i++) 
	{ 
		//alert(frames[i].name);
		if (frames[i].name==dest)
			{
				frames[i].location = path 
				return;
			}
	}
    frames = parent.document.frames;
	for (i = 0; i < frames.length; i++) 
	{ 
		//alert(frames[i].name);
		if (frames[i].name==dest)
			{
				frames[i].location = path 
				return;
			}
	}
   
   
// up to here for ie5up

   
   // JavaScript here for IE 4 and later
}else  {
		alert('browser not recognised');}
}



function Navi(url, target,targetType)
{
if (targetType == "frame")
	{
		for (x=0; x < (document.frames.length);++x)
			{
				if (document.frames.item(x).name==target)
				{
					alert('on doclevel');
					document.frames.item(x).navigate(url);
					return;
				}
			}
	}
}



function Click (obj)
	{
	 parent.document.frames("main").navigate("./CC-" + obj.id + ".htm");
     
     

	}

	function Nav (url)
	{
		bNavTo('main','./CC-' + url + '.htm'); 
	}

	
	function Style(obj) 
	
	{
	
	
	
	}
	
	function MouseOver(obj)
	
	{
	 // alert('Mouse over' + obj);
	  obj.style.color = '#3426fb';
	  obj.style.cursor='hand';// IE ONLY
	  obj.style.fontWeight = 'bold';
	}
	//  style="FONT-WEIGHT: bold; COLOR: blue"
	
	
	function MouseLeave(obj)
	
	{
	  obj.style.color = '#000000';
	  obj.style.cursor='default'// ; IE ONLY
	  obj.style.fontWeight = 'normal';
	}



	function ClickProd (obj,dest)
	{
	 
		bNavTo(dest,"./CC-" + obj.id + ".htm");

	}
	

				function getUrl(u)
				
				{
					while ( u.length > 1 && (u.charAt(u.length-1) !="/" ))
					{
					u = u.substring(0,u.length-1);
					
					}
					return u;
				}
				
	
				
							
				
					var u2 = getUrl(document.URLUnencoded);
								
					if (parent.parent.parent.frames.length==0)
					{
			       		window.navigate(u2);

						
					}
					
					
					if (parent.parent.parent.parent.frames(1).name!="contents")  //(parent.frames.length>0)// && parent.frames(
				       	{
				       	
				       		alert("houston we have a probelm");
				       		window.navigate(u2);
				       	
				       					       	
						} else
						{
						 //alert("seems ok");
						}
	