<!--

/*
This is our function to use xmlhttp requrests, i did not write this part w3 schools did
[url=http://www.w3schools.com/ajax/ajax_browsers.asp]http://www.w3schools.com/ajax/ajax_browsers.asp[/url]
This was quicker than just making my own :)
*/
var xmlHttp // xmlHttp variable

function GetXmlHttpObject(){ // This function we will use to call our xmlhttpobject.
var objXMLHttp=null // Sets objXMLHttp to null as default.
if (window.XMLHttpRequest){ // If we are using Netscape or any other browser than IE lets use xmlhttp.
objXMLHttp=new XMLHttpRequest() // Creates a xmlhttp request.
}else if (window.ActiveXObject){ // ElseIf we are using IE lets use Active X.
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") // Creates a new Active X Object.
} // End ElseIf.
return objXMLHttp // Returns the xhttp object.
} // Close Function

function reviewvalidate() {
	var f = this.document.postreview;
	var errors = "";
	var errorcount = 0;
if (f.r_name.value=="") {
	errorcount++; 
	errors += "Please enter your name";
	}
if (f.r_email.value=="") {
	errorcount++;
	errors += "\nPlease enter your email";
	}
if (f.r_rating.value==0) {
	errorcount++;
	errors += "\nPlease select a rating";		
	}
if (f.r_review.value=="") {
	errorcount++;
	errors += "\nPlease type your review";		
	}

if (errorcount > 0)
	alert(errors);
else
	f.submit();
}
function ChangeGift(){
//document.getElementById('SpanChoose').style.visibility = 'visible';
document.getElementById('SpanChoose').innerHTML = document.getElementById('TempDesc').innerHTML;
document.getElementById('SpanDesc').innerHTML = "";
document.getElementById('Buy').style.visibility = "visible";

xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.
var d = new Date();
var time = d.getTime();
var url="session_expire.php?t="+time; // Url that we will use to check the username.
//var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading List<br>Please Wait!</h1></div>';
//var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
	//alert(xmlHttp.responseText);
//document.getElementById("divmsg").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	//document.getElementById("divmsg").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
//}
//}

}
function SelectedValue(Name,DealID,GiftID,GiftType)
{
BuyNowQryStr="<a href='cart_add.php?_action=AddToCart&amp;type=D&amp;productid="+DealID+"&amp;qty=1&amp;gid="+GiftID+"&amp;gt="+GiftType+"' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage(\"bnimg\",\"\",\"images/buy-now_green.gif\",1)'><img src='images/buy-now2.gif' id='bnimg' name='bnimg' border='0' alt='123' /></a>";
//alert(BuyNowQryStr);
document.getElementById('ListTwo').innerHTML = "";
document.getElementById('ListOne').innerHTML = "";
document.getElementById('SpanDesc').innerHTML = "";
//document.getElementById('SpanChoose').style.visibility = "hidden";
document.getElementById('TempDesc').innerHTML = document.getElementById('SpanChoose').innerHTML;
document.getElementById('SpanChoose').innerHTML="";
document.getElementById('SpanDesc').innerHTML = "<table border='0' width='100%' cellspacing='0' cellpadding='6' align='center'><tr><td valign='top' align='right'><img src='images/checkA.jpg' border='0'></td><td class='num2' align='left'>Selected "+Name+" as a free gift.</td></tr><tr><td colspan='2' align='center'><a href='javascript:' onclick='ChangeGift()' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage(\"cgimg\",\"\",\"images/change_gift_green.gif\",1)'><img src='images/change_gift.gif' id='cgimg' name='cgimg' border='0'/></a>&nbsp;&nbsp;<span id='BuyNow'></span></td></tr></table>";
//document.getElementById('BuyNow').innerHTML = document.getElementById('Buy').innerHTML;
document.getElementById('BuyNow').innerHTML =BuyNowQryStr;
document.getElementById('Buy').style.visibility = "hidden";
}
function getNewList(SelVal,DivID,Price,type,DealID) {
//document.getElementById('ListTwo').innerHTML = "";
//alert(SelVal);
if(SelVal!=""){
if(SelVal=="P" || SelVal=="A"){document.getElementById('ListTwo').innerHTML = "";}
document.getElementById('SpanDesc').innerHTML = "";
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="get_new_list.php?sid="+SelVal+"&p="+Price+"&t="+type+"&did="+DealID; // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading List<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
	//alert(xmlHttp.responseText);
document.getElementById(DivID).innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById(DivID).innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}
}
function ChangeGift3(PageName) {
//alert(window.location);
window.location.href =PageName+"?exs=1";
//window.location.assign(PageName); //PageName+"?";

//location.href = "newPage.html";
//alert(window.location);
//window.location.reload();
}
function ChangeGift2(PageName,DSession) {
//document.getElementById('ListTwo').innerHTML = "";
//alert(SelVal);
//if(SelVal!=""){
//if(SelVal=="P" || SelVal=="A"){document.getElementById('ListTwo').innerHTML = "";}
//document.getElementById('SpanDesc').innerHTML = "";
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="inc.gift_section_main.php?page="+PageName+"&ds="+DSession; // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading List<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
	//alert(xmlHttp.responseText);
document.getElementById("divmsg").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById("divmsg").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
//}
}

function getNewList2(SelVal,DivID,Price,type,DealID,PageName) {
//alert("ok");
//document.getElementById('ListTwo').innerHTML = "";
//alert(SelVal);
if(SelVal!=""){
if(SelVal=="P" || SelVal=="A"){document.getElementById('ListTwo').innerHTML = "";}
document.getElementById('SpanDesc').innerHTML = "";
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="get_new_list_main.php?sid="+SelVal+"&p="+Price+"&t="+type+"&did="+DealID+"&pn="+PageName; // Url that we will use to check the username.
//alert(url);
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading List<br>Please Wait!</h1></div>';
var url= uncache(url);
//alert('yes');
xmlHttp.open("GET",url,true) // Opens the URL using GET

xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
	
	//alert(xmlHttp.responseText);
document.getElementById(DivID).innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById(DivID).innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}
}
function SelectedValue2(GiftName,PageName,GiftID,GiftType)
{
 //alert(PageName+"?gid="+GiftID+"&gtype="+GiftType+"&gn="+GiftName);
 window.location=PageName+"?gid="+GiftID+"&gtype="+GiftType+"&gn="+GiftName;
/*BuyNowQryStr="<a href='cart_add.php?_action=AddToCart&amp;type=D&amp;productid="+DealID+"&amp;qty=1&amp;gid="+GiftID+"&amp;gt="+GiftType+"' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage(\"bnimg\",\"\",\"images/buy-now_green.gif\",1)'><img src='images/buy-now2.gif' id='bnimg' name='bnimg' border='0' alt='' /></a>";
//alert(BuyNowQryStr);
document.getElementById('ListTwo').innerHTML = "";
document.getElementById('ListOne').innerHTML = "";
document.getElementById('SpanDesc').innerHTML = "";
//document.getElementById('SpanChoose').style.visibility = "hidden";
document.getElementById('TempDesc').innerHTML = document.getElementById('SpanChoose').innerHTML;
document.getElementById('SpanChoose').innerHTML="";
document.getElementById('SpanDesc').innerHTML = "<table border='0' width='100%' cellspacing='0' cellpadding='6' align='center'><tr><td valign='top' align='right'><img src='images/checkA.jpg' border='0'></td><td class='num2' align='left'>Selected "+Name+" as a free gift.</td></tr><tr><td colspan='2' align='center'><a href='javascript:' onclick='ChangeGift()' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage(\"cgimg\",\"\",\"images/change_gift_green.gif\",1)'><img src='images/change_gift.gif' id='cgimg' name='cgimg' border='0'/></a>&nbsp;&nbsp;<span id='BuyNow'></span></td></tr></table>";
//document.getElementById('BuyNow').innerHTML = document.getElementById('Buy').innerHTML;
document.getElementById('BuyNow').innerHTML =BuyNowQryStr;
document.getElementById('Buy').style.visibility = "hidden";*/
}

//ShowHideSimDesc()
function ShowHideSimDesc(simid,divid,spanid) {
DetailType = document.getElementById(spanid);
if(DetailType.innerHTML =='Show Details'){
DetailType.innerHTML ='';
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="get_sim_desc.php?sid="+simid; // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading Description<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);
document.getElementById(divid).innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
DetailType.innerHTML ='Hide Details';
}
else {
	document.getElementById(divid).innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}else if(DetailType.innerHTML =='Hide Details'){
document.getElementById(divid).innerHTML ="";
DetailType.innerHTML='Show Details';
}}

function getphonefeat(featid) {
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="getphonefeatures.php?featid="+featid // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading Feature<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);
document.getElementById("fdetail").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById("fdetail").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}



function fetchphonedetails(phoneid) {
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="getphonedetails.php?p="+phoneid; // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading Mobile Phone Information<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);
document.getElementById("phonedetails").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
//document.getElementById("ByNowDiv").style.visibility = "visible";
}
else {
	document.getElementById("phonedetails").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}

function fetchphonedetails2(phoneid,simid) {
document.getElementById("ByNowDiv").style.visibility = "hidden";
document.getElementById("simdetails").innerHTML ="";
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="get_prepaid_details.php?p="+phoneid+"&sid="+simid; // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading Mobile Phone Information<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);
document.getElementById("phonedetails").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
//document.getElementById("ByNowDiv").style.visibility = "visible";
}
else {
	document.getElementById("phonedetails").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}

function fetchsimdetails(simid,phoneid) {
document.getElementById("ByNowDiv").style.visibility = "hidden";	
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url=" get_prepaid_sim_detail.php?sid="+simid+"&pid="+phoneid; // Url that we will use to check the username.
var doLoading = '<div align="center"><img src="images/loading.gif" alt="" /><br><h1>Loading Mobile Phone Information<br>Please Wait!</h1></div>';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);

document.getElementById("simdetails").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
document.getElementById("ByNowDiv").style.visibility = "visible";
}
else {
	document.getElementById("simdetails").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}


function showcallcharges(tid) {
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="showcallcharges.php?tid="+tid // Url that we will use to check the username.
var doLoading = '<div align"center"><img src="images/loading.gif" alt="" /><br><h1>Loading Tariff Details<br>Please Wait!</h1></div>';
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("tarifdetails").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById("tarifdetails").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
}

function showrating(rating) {
	var f = this.document.postreview;
	
if (rating=="") { 
document.getElementById("ratingdefined").innerHTML = "";
} else {
document.getElementById("ratingdefined").innerHTML = "<img src='http://www.thatzcool.co.uk/images/"+rating+"_med_stars.gif'>";
}

}

function uncache(url){
var d = new Date();
var time = d.getTime();

return url+'&time='+time;
} 

function PostReview(name, email, rating, review){ // This function we will use to check to see if a username is taken or not.
//alert(ccnum);
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="insertreview.php?name="+name+"&email="+email+"&rating="+rating+"review"; // Url that we will use to check the username.
var doLoading = '<img src="images/loading.gif" alt="" />';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);
document.getElementById("cardvalidresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById("cardvalidresult").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
} // Close Function.


function CheckCardNumber(ccnum){ // This function we will use to check to see if a username is taken or not.
//alert(ccnum);
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="bankvalcard.php?cardnumber="+ccnum // Url that we will use to check the username.
var doLoading = '<img src="images/loading.gif" alt="" />';
var url= uncache(url);
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
//	alert("State: "+xmlHttp.readyState);
//	alert(xmlHttp.responseText);
document.getElementById("cardvalidresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
}
else {
	document.getElementById("cardvalidresult").innerHTML = doLoading;	
}
// End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
} // Close Function.

function CheckEmailAddress(txtEmail){ // This function we will use to check to see if a username is taken or not.
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Browser does not support HTTP Request") // Alert Them!
return // Returns.
} // End If.

var url="checkemailadd.php?x_txtEmail="+txtEmail // Url that we will use to check the username.
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("emailaddresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
} // End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
} // Close Function.

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_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_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 openwindow(pagename,wd,ht)
{
	window.open(pagename,'mywindow','menubar=0,scrollbars=no,width='+wd+',height='+ht+',left=100,top=40');
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
}
function showpop(obj){
	id = obj.id;
	dvid = id + ".2";
	dv = document.getElementById(dvid);
	cord = findPos(obj);
	//alert(cord);
	dv.style.left = (cord[0]-175)+"px";
	dv.style.top = cord[1]+"px";
	//alert(dv.style.left);
	dv.style.display = "block";	
}
function hidepop(obj){
	id = obj.id;
	dvid = id + ".2";
	dv = document.getElementById(dvid);
	dv.style.display = "none";
}

	function qsearch(frm){
//		var url = "<?=ROOT.$arrfile["network"]?>/";
//	var ROOT = "http://www.thatzcool.co.uk/";
	var ROOT = "http://www.thatzcool.co.uk/";
var skey = frm.searchkey.value;
			if(frm.searchkey.value != ""){
			var url=ROOT+"search-results/"+skey+"/x1.html";
			}
			else {
				var url=ROOT;	
			}
	document.location = url;
	
return false;
	}

//-->