document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\" >");
if(self.location != top.location)
{
top.location.href = self.location
}

function showSubmitBox()
{
document.getElementById("add").style.top="82";
}

function openWindow(url)
{
var URL=document.location.href;
var URL_array=URL.split("/");
var dirnum = URL_array.length;
i = "3";
z = "0";
path = new Array()
	while(i <= dirnum-1)
	{
	path[z++] = URL_array[i++]
	}
isPath = "/"+path.join("/");
imgWindow = window.open("/pic.html?image="+isPath+url+"","image_window","top=200,left=200,menubar=no,location=no,resizable=yes,scrollbars=no,width=10,height=10");
imgWindow.focus();
}

function openDocument(url,name,opt)
{
window.open(url,name,opt);
}


function get(name)
{
	var query = window.location.search.substring(1);
	var qstringsplit = query.split("&");
	t = "0";
	while(t <= qstringsplit.length-1)
	{
		eachval = qstringsplit[t];
		valsplit = eachval.split("=");
        i = "0";j = "1";
        while(i <= qstringsplit.length-1)
		{
			if(valsplit[i] == name)
			{
				var returnthis = valsplit[j];
				var returnthisArr = returnthis.split("+");
				var returnthisCount = returnthisArr.length-1;
				
				for(b=0; b<=returnthisCount; b++)
				{				
					returnthis = returnthis.replace("+"," ");
				}
				return returnthis;
			}
			i++;j++;
		}
		t++;
	}
}


function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else
	{
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}

function popunder(purl)
{
	if(!readCookie("__POPUNDER__"))
	{
		createCookie("__POPUNDER__",purl,"1");
		var popunder = window.open(purl,"Popunder");
		popunder.blur();
	}
}
function backLoad()
{
	if(document.getElementById("tdc"))
	{
		document.getElementById("tdc").innerHTML = '<embed src="http://static.awempire.com/flash/live_feeds/myc/livefeed_preloader_mycams.swf" width="600" height="350" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" flashvars="appletroot=http://static.awempire.com/flash/live_feeds/myc/skins/&appletskin=mycams_wma_001_600x350_01.swf&appletcol=666666&psid=626163&pstour=t1&psprogram=PPS&site=myc&flags=137438953473,137438953504,1,32&tmbfeed=true&preloadurl=http://static.awempire.com/flash/live_feeds/myc/livefeed_info.xml"></embed>';
		adcenter = document.createElement('center');
		adcenter.innerHTML = '<embed width="524" height="768" bgcolor="#FFFFFF" allowscriptaccess="always" src="http://galleries.videosz.com/wall2.swf" flashvars="&link_id=17256&tracker_id=&lg=us&cols=4&rows=8&linkto=2&dt=1&filter=date&moving=false&randomize=true&spacing=1&genre_id=0&actor_id=0&showshadow=false&tgtw=2" type="application/x-shockwave-flash" />';
		document.getElementById("mainbody").appendChild(adcenter);
		
		if(get("term"))
		{
			document.getElementById("searchterm").value = get("term");
		}
		var fileref=document.createElement('script');
		fileref.setAttribute("type","text/javascript");
		fileref.setAttribute("src",'/toplist.js');
		document.getElementsByTagName("head")[0].appendChild(fileref);
		clearInterval(initBackLoad);
	}
}
initBackLoad = setInterval("backLoad()",250);
