// JavaScript Document

var bgsleight	= function() {
	
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			}
		}
	}
	
	function fnLoadPngs() {
		var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
		var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5 && Number(rslt[1]) < 7);
		//for (var i = document.all.length - 1, obj = null; (obj = document.all[i]); i--) {
			obj = document.getElementById("head");
			if (itsAllGood && obj.currentStyle.backgroundImage.match(/\.png/i) != null) {
				fnFixPng(obj);
				obj.attachEvent("onpropertychange", fnPropertyChanged);
			}
			obj = document.getElementById("cont");
			if (itsAllGood && obj.currentStyle.backgroundImage.match(/\.png/i) != null) {
				fnFixPng(obj);
				obj.attachEvent("onpropertychange", fnPropertyChanged);
			}
			obj = document.getElementById("foot");
			if (itsAllGood && obj.currentStyle.backgroundImage.match(/\.png/i) != null) {
				fnFixPng(obj);
				obj.attachEvent("onpropertychange", fnPropertyChanged); m.style.position='relative';
			}

				   var string = "<iframe src='skyscrapper.html' width=120 height=2200 frameborder='0' scrolling=no></iframe>";
				   if(document.getElementById('ads'))document.getElementById('ads').innerHTML = string;
				   var string = "<iframe src='underflash.php' width=728 height=350 frameborder='0' scrolling=no></iframe>";
				   if(document.getElementById('ads2'))document.getElementById('ads2').innerHTML = string;
		//}
	}

	function fnPropertyChanged() {
		if (window.event.propertyName == "style.backgroundImage") {
			var el = window.event.srcElement;
			if (!el.currentStyle.backgroundImage.match(/blank\.gif/i)) {
				var bg	= el.currentStyle.backgroundImage;
				var src = bg.substring(5,bg.length-2);
				el.filters.item(0).src = src;
				el.style.backgroundImage = "url(images/blank.gif)";
			}
		}
	}

	function fnFixPng(obj) {
		var bg	= obj.currentStyle.backgroundImage;
		var src = bg.substring(5,bg.length-2);
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
		obj.style.backgroundImage = "url(images/blank.gif)";
	}
	
	
	
	
	return {
		
		init: function() {
			
//			if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
				addLoadEvent(fnLoadPngs);
//			}
			
		}
	}
	
}();

bgsleight.init();

function addBookmark(url, title) 
{ 
  if (!url) url = location.href; 
  if (!title) title = document.title; 

  //Gecko 
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel ("HQTube - Streaming porn!", "http://www.hqtube.com", ""); 
   //IE4+ 
  else if (typeof window.external == "object") window.external.AddFavorite("http://www.hqtube.com","HQTube - Streaming porn!");
    //Opera7+ 
  else if (window.opera && document.createElement) 
  { 
    var a = document.createElement('A'); 
    if (!a) return false; //IF Opera 6 
    a.setAttribute('rel','sidebar'); 
    a.setAttribute('href',url); 
    a.setAttribute('title',title); 
    a.click(); 
  } 
  else return false; 

  return true; 
}

function al(clipdata){
	if (document.location.search.indexOf('freemov=')==1) {
		document.location.href="/";
		return false;
	}
	document["hqttvpl"].SetVariable("jsvar",clipdata);
	return false;
	var ua=navigator.userAgent.toLowerCase(); 
	var is_pc_ie=( ((ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 )) || ( ua.indexOf('opera') != -1 ));
	var i,values;
	if(is_pc_ie){
		document["hqttvpl"].SetVariable("jsvar",clipdata);
	}else{
		var divcontainer = "flash_setvariables_jeplayer";
		if(!document.getElementById(divcontainer)){
			var divholder = document.createElement("div");
			divholder.id = divcontainer;
			document.body.appendChild(divholder);
		}
		document.getElementById(divcontainer).innerHTML = "";
		//var divinfo = "<embed src='gateway.swf' FlashVars='elem="+clipdata+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		var divinfo = "<embed src='gateway.swf?elem="+clipdata+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		document.getElementById(divcontainer).innerHTML = divinfo; //alert(divinfo);
	}
	return false;
}

function galls(s) {
	window.open('galls.php?'+s,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=640,height=620');
	return false;
}
