// this is the generic window opener...
function openWindowGen(url,name,width,height,top,left,resize,scroll) 
{	
	var temp = "window.open('" + url + "', '" + name + "', '" + "width=" + width + ',height=' + height + ',top=' + top + ',left=' + left + ',resizable=' + resize + ',scrollbars=' + scroll + "')";
	eval(temp);
}

// This function writes the hero flash embed, to avoid the "press ok to continue loading" alert.
function writeHero()
{
	var str='';
	
	str += '		<div style=\"height:auto; margin-bottom:0px;\">';
	str += '			<object class id=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"788\" height=\"180\">';
	str += '				<param name=\"movie\" value=\"/includes/hero_080422.swf\" />';
	str += '				<param name=\"quality\" value=\"high\" />';
	str += '				<param name=\"wmode\" value=\"opaque\" > ';
	str += '				<embed src=\"/includes/hero/hero_080422.swf\" wmode=\"transparent\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"788\" height=\"180\"></embed>';
	str += '			</object>';
	/* DP 13.05.2008
	str += '			<script src=\"/js/ieupdate.js\" type=\"text/javascript\"></script>';
	*/
	str += '		</div>';
	
	document.write(str);
}

function CreateBookmarkLink()
{
	title = "Page3.com";
	url = "http://www.page3.com";
	
	if (window.sidebar) // Mozilla Firefox Bookmark
	{
		window.sidebar.addPanel(title, url, "");
	}
	else if (document.all) // IE Favorite
	{
		window.external.AddFavorite(url, title);
	}
	else if (window.opera && window.print) // Opera Hotlist
	{
		return true;
	}
}

// change the content height
function modHeight (id) {  
	var gh = document.getElementById(id).offsetHeight + 20;
				
	// 1144 is pull_content default height
	if(gh > 1144)
	{
		var diff = gh - 1144;
		document.getElementById(id).style.height = gh + 'px';
		if(document.getElementById('main_content')) 
			document.getElementById('main_content').style.height = (document.getElementById('main_content').offsetHeight + diff) + 'px';
		if(document.getElementById('content_left')) 
			document.getElementById('content_left').style.height = (document.getElementById('content_left').offsetHeight + diff) + 'px';
		if(document.getElementById('content_right')) 
			document.getElementById('content_right').style.height = (document.getElementById('content_right').offsetHeight + diff) + 'px';
		if(document.getElementById('pull_content_tv')) 
			document.getElementById('pull_content_tv').style.height = (document.getElementById('pull_content_tv').offsetHeight + diff) + 'px';
		if(document.getElementById('search_girls')) 
			document.getElementById('search_girls').style.height = (document.getElementById('search_girls').offsetHeight + diff) + 'px';
		if(document.getElementById('border_left1')) 
			document.getElementById('border_left1').style.height = (document.getElementById('border_left1').offsetHeight + diff) + 'px';
		if(document.getElementById('border_right1')) 
			document.getElementById('border_right1').style.height = (document.getElementById('border_right1').offsetHeight + diff) + 'px';
		if(document.getElementById('border_left2')) 
			document.getElementById('border_left2').style.height = (document.getElementById('border_left2').offsetHeight + diff) + 'px';
		if(document.getElementById('border_right2')) 
			document.getElementById('border_right2').style.height = (document.getElementById('border_right2').offsetHeight + diff) + 'px';
		}
	//alert(document.getElementById(id).offsetHeight);
}




/* Sophus3 logging request. http://www.sophus3.com
 * Copyright (c) Sophus Ltd 2000-2007. All rights reserved. Patent Pending.
 * Change the value of tc_logging_active to switch off logging on the site.
 
  20071217 - tc_log_path changed and script activated - BKo
 
*/
 
tc_logging_active = true;
 
if (typeof tc_logging_active == 'undefined') tc_logging_active = false;
 
tc_site_id = 2;
 
// required configuration parameters
tc_server_url = "sun.sophus3.com";
 
// Change to match directory location of logging-code.js file from root (start with /) or relativly
tc_log_path = "/fg-static/fg-dtfc07/images/";
 
/* Touch Clarity content request. http://www.touchclarity.com
 * Copyright (c) Touch Clarity Ltd 2001-2004. All rights reserved. Patent Pending.
 * Version 3.4
 */
 
function tc_configured() {
 tc_tag_version="3.4";
 tc_dtimeout=5000;
 tc_d_loc=window.location;
 tc_sent=0;
 if (typeof tc_server_url==tc_ud||typeof tc_site_id==tc_ud) return false;
 if (typeof tc_log_page==tc_ud||tc_log_page=="") tc_log_page="logging.html";
 tc_layer=(document.layers?1:0);
 tc_frame=(document.getElementById||document.all?1:0);
 tc_timeout=(typeof tc_timeout==tc_ud?tc_dtimeout:tc_timeout*1000);
 tc_encfn=(typeof encodeURIComponent!=tc_ud?encodeURIComponent:escape);
 tc_http="http"+(tc_d_loc.href.substring(0,6)=="https:"?"s":"")+"://";
 tc_server_url=tc_http+tc_server_url;
 tc_url=((typeof tc_page_alias!=tc_ud)?tc_page_alias:tc_d_loc.href);
 if (typeof tc_extra_info!=tc_ud) tc_url+=(tc_url.indexOf("?")>0?"&":"?")+tc_extra_info;
 tc_extra_info="";
 tc_products=(typeof tc_products==tc_ud?"":tc_products);
 tc_ccs = new Array();
 tc_referrer=(typeof tc_referrer!=tc_ud&&tc_referrer!=""&&tc_referrer!=null?tc_referrer:(typeof document.referrer==tc_ud?tc_ud:(document.referrer==null?"null":(document.referrer==""?"empty":document.referrer))));
 tc_time = new Date().getTime();
 return true;
}
 
function tc_log(alias, products, displayed) {
 if (!tc_logging_active) return;
 alias=tc_fixURL(alias);
 tc_image=new Image();
 tc_image.src=tc_get_log_URL("i",alias,tc_products,new Date().getTime(), displayed);
}
 
function tc_redirect(target,url,alias,winproperties,products,script) {
 if (typeof url==tc_ud||url=="") return;
 if (typeof script==tc_ud||script=="") script="tc_d_loc.href='"+url+"'";
 url=tc_fixURL(url);
 if (typeof alias==tc_ud) alias=url;
 alias=tc_fixURL(alias);
 if (typeof target==tc_ud||target==""||target=="_self") {
  if (tc_logging_active) {
   tc_timer=new Image();
   tc_timer.onload=function() { eval(script); clearTimeout(tc_timeout_id); }
   tc_timer.onerror=function() { eval(script); clearTimeout(tc_timeout_id); }
   tc_timer.src=tc_get_log_URL("i",alias,products,new Date().getTime());
   tc_timeout_id=setTimeout(script,tc_timeout);
  } else { eval(script); }
 } else if (typeof target=="object"&&target.document) {
  if (tc_logging_active) { tc_timer=new Image();tc_timer.src=tc_get_log_URL("i",alias,products); }
  target.location.href=url;
 } else { return tc_open_window(target,url,alias,winproperties,products); }
}
 
function tc_open_window(name,url,alias,winproperties,products) {
 if (typeof url==tc_ud||url=="") return false;
 if (tc_logging_active) { tc_timer=new Image();tc_timer.src=tc_get_log_URL("i",alias,products,new Date().getTime()); }
 if (typeof winproperties==tc_ud) return window.open(url,name);
 else { return window.open(url,name,winproperties) }
}
 
function tc_dltime() {
 if (!(document.getElementById||document.all)) return false;
 if (tc_logging_active&&(typeof tc_done!="undefined")&&tc_done&&!tc_sent) { setTimeout("tc_dltime()",1000);return false; }
 var sent=tc_sent;
 tc_image=new Image();
 tc_image.src=tc_get_log_URL("d");
 return sent;
}
 
function tc_get_log_URL(type,locn,products,time,displayed) {
 if (typeof type==tc_ud) type='i';
 var url=tc_server_url+"/"+type+"?siteID="+tc_site_id;
 if (type!="d") {
  url+="&ts="+(typeof time!=tc_ud?time:tc_time);
  var al = tc_isAlias(locn);
  if (typeof tc_containers!=tc_ud) for(cc in tc_containers) url+="&ccID="+tc_containers[cc];
  if (type=="c") url+="&log=no";
  if (al) url+="&alias=true";
  if ((typeof products!=tc_ud)&&products.length) url+="&prod="+tc_encfn(products);
  if (typeof displayed!=tc_ud) url+=displayed;
  if (locn==tc_ud) locn=tc_d_loc;
  locn=tc_encfn(locn);
  while (locn.length>1999-url.length) locn=locn.substring(0,locn.lastIndexOf(tc_encfn("&")));
  url+="&location="+locn;
  var dg=new Object();
  dg.tagv=tc_tag_version;
  dg.tz=0-(new Date().getTimezoneOffset());
  dg.r=tc_encfn(tc_referrer);
  if (al) dg.aliased=tc_encfn(tc_d_loc.href);
  dg.title=tc_encfn(document.title);
  if (screen) {dg.cd=screen.colorDepth;dg.ah=screen.availHeight;dg.aw=screen.availWidth;dg.sh=screen.height;dg.sw=screen.width;dg.pd=screen.pixelDepth;}
  for (var key in dg) { var param="&"+key+"="+dg[key]; if (url.length+param.length<2000) url+=param; else break; }
 } else {
  url+="&dlts="+tc_time+"&dl="+(new Date().getTime()-tc_time);
 }
 return url;
}
 
function tc_fixURL(url) {
 if (url=="") { return tc_d_loc.href }
 if ((url.substring(0,4)!='http')&&(url.substring(0,1)!="/")) { url=tc_d_loc.pathname.substring(0,tc_d_loc.pathname.lastIndexOf('/')+1)+url }
 if (url.substring(0,1)=="/") { url=tc_http+tc_d_loc.host+url }
 return url;
}
 
function tc_isAlias(alias) {
 alias=(typeof alias!=tc_ud?alias:(typeof tc_page_alias==tc_ud?"":tc_page_alias));
 alias=tc_fixURL(alias);
 if (alias.indexOf("?")>0) alias=alias.substring(0,alias.indexOf("?"));
 return (alias != tc_http+tc_d_loc.host+tc_d_loc.pathname);
}
 
function tc_loader() {
 tc_ud="undefined";
 if (typeof tc_log_path==tc_ud||tc_log_path=="") tc_log_path="/touchclarity";
 if ((typeof tc_containers!="undefined")&&(tc_containers.length>0)) { document.write("<scr"+"ipt language='JavaScript' type='text/javascript' src='" + tc_log_path + "/optimise.js'></scr"+"ipt>\n"); }
 else {
  if (tc_logging_active&&tc_configured()&&(typeof tc_done==tc_ud||tc_done==false)) {
   url=tc_fixURL(tc_url);
   tc_image=new Image();
   tc_image.onload=function(){tc_sent=true;}
   tc_image.src=tc_get_log_URL("i",url,tc_products,tc_time);
  }
  tc_done = true;
 }
}
 
tc_loader();
