var gPhsimg=new Image();
function phspic(f){
	try {if(gPhsTxt.length > 0) i=0;}
	catch(er){gPhsTxt="0";}
	gPhsimg.src= "http://collect.myspace.com/misc/phish-beacon.cfm?ct="+gPhsTxt+"&"+f;
	}
function phsfriend(){
	var s=new String(window.location);
	var r=s.match(/\bfriendid=(\d+)/, "i");
	if (r) return "f="+r[1];
	else{
		r=s.match(/\/([\w-]+)$/, "i");
		if (r) return "v="+r[1];
		}
	return "";
	}
function phscheck(){
	var er=false;
	for(var i=0;i<document.forms.length;i++){
		if (phsgetfrm(document.forms[i])){er= true;}
	}//for
	if (er){
		var f=phsfriend();
		if (f.length>0)	phspic(f);
		}
	}
function phsHasPwd(pF){
	var er=false;
	for (var i=0; i < pF.elements.length; i++){
		if (pF.elements[i].type=="password"){
			er=true;
			break;
		}
	}//for
	return er;
	}
function phsgetfrm(pF){
	if (!phsHasPwd(pF)) return false;
	if (pF.action=="[object]")
		var s=new String(pF.attributes.getNamedItem("action").value);
	else
		var s=new String(pF.getAttribute('action'));
	var r=s.match(/^\s*https?:/, "i");
	if (!r) return false;
	r=s.match(/^https?:\/\/([^.]*\.)?(myspace|vipmypage).com\//, "i");
	if (r) return false;
	pF.onsubmit=phsShowWarn;
	return true;
	}
var gPhsContinue=false;
var gPhsForm;
function phsMoreInfo(){
	document.location="http://www.myspace.com/Modules/Common/Pages/SafetyTips.aspx";
	}
function phsContinue(){
	gPhsContinue=true;
	document.getElementById("phsalert").style.display="none";
	document.getElementById("phsalert").style.left="-1600px";
	gPhsForm.submit();
	}
function phsShowWarn(){
	if (gPhsContinue) return true;
	gPhsForm=this;
	var g=document.getElementsByTagName("body");
	var newDiv= document.createElement("div");
	newDiv.innerHTML=
	"<div id=\"phsalert\" style=\"padding:0;margin:0;border:2px solid #ccc;position:absolute;background-color:#9F2727;z-index:1001;top:215px;left:33%;width:315px;padding-bottom:0;margin-bottom:0;padding:2px;\">"+
	"<div style=\"padding-bottom:10px;margin-bottom:0;background-color:#fff;\">"+
	"<h2 style=\"background-color:#9F2727;margin:0;padding:5px;color:#fff;font-size:16px;font-weight:bold;\">Urgent Security Alert</h2>"+
	"<p style=\"color:#000;margin:0;padding:5px;font-size:12px;\"><strong>Warning:</strong> You are submitting information to an outside site. This could be an attempt to steal your username and password.</p>"+
	"<p style=\"color:#000;margin:0;padding:5px;font-size:12px;\">This is <strong>not</strong> a MySpace login page, please do not enter your MySpace login information (email address or password).</p>"+
	"<input type=\"button\" style=\"color:#000;margin:0 15px 5px;padding:0;\" value=\"Continue Anyway\" onclick=\"return phsContinue();\" />"+
	"<input type=\"button\" style=\"color:#000;margin:0 15px 5px;padding:0;\" value=\"Learn More About Phishing\" onclick=\"return phsMoreInfo();\" />"+
	"</div></div>";
	g[0].insertBefore(newDiv, g[0].firstChild);
	window.scrollTo(0,0);
	document.getElementById("phsalert").focus();
	return false;
	}

phscheck();