

abtracker01_onoff = 0;
abtracker02_onoff = 0;

/* Begin ABTracker02 Event Trackers */
/* in order for abtracker02 to work, the following functions must be called in all the appropriate places */

function pageLoadSuccess()
	{
	if (abtracker01_onoff && $_GET["id"]) $.get("/abtracker01/record_data.php",{id:$_GET["id"],increment:"impressions"});
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.onPageLoad();
	pageLoadSuccess = function(){};
	}

function autoSearchSuccess()
	{
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("auto_searches");
	}

function manualSearchSuccess()
	{
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined")
		{
		if (!ABTracker02.data.manual_searches) ABTracker02.increment_data("single_manual_searches");
		ABTracker02.increment_data("manual_searches");
		}
	}

function regFormSuccess()
	{
	if (typeof(regFormSuccessfullySubmitted) == "function") regFormSuccessfullySubmitted();
	if (abtracker01_onoff && $_GET["id"]) $.ajax({type:"GET",url:"/abtracker01/record_data.php",async:false,data:{id:$_GET["id"],increment:"registrations"}});
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("successful_regs");
	regFormSuccess = function(){};
	}

function regOpenSuccess()
	{
	fireRegOpenedPixel();
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("reg_opens");
	}

function regCloseSuccess()
	{
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("reg_closes");
	}

function softmatchSuccess()
	{
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("softmatches");
	}

function softmatchNotMeSuccess()
	{
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("softmatch_notmes");
	}

function fireGenericEvent(event_num)
	{
	if (abtracker02_onoff && typeof(ABTracker02) != "undefined") ABTracker02.increment_data("event"+event_num);
	}

/* End AbTracker02 Event Trackers */

function psOnSubmit()
	{
	return formOnSubmit("ps");
	}

function wsfyOnSubmit()
	{
	return formOnSubmit("wsfy");
	}

function formOnSubmit(type)
	{
	var f = $("#"+type+"Form");
	f[0].submitted_once = true;
	var ok = true;
	
	var fn = $("[name='"+(type=="ps"?"searchFirstName":"firstName")+"']",f);
	var ln = $("[name='"+(type=="ps"?"searchLastName":"lastName")+"']",f);
	var a = $("[name='"+(type=="ps"?"searchAge":"age")+"']",f);

	if (fn.val() != fn[0].defaultValue) fn.val(fixName(fn.val()));
	if (ln.val() != ln[0].defaultValue) ln.val(fixName(ln.val()));
	if (a.val() != a[0].defaultValue) a.val(fixAge(a.val()));
	
	var des = type == "ps" ? "their" : "your";
	if (!inputHasValue(fn)) ok = alertField(fn,{id:"first_name",message:"Please enter "+des+" <strong>first name</strong>."});
	else alertField(fn,{id:"first_name"},true);
	if (!inputHasValue(ln)) ok = alertField(ln,{id:"last_name",message:"Please enter "+des+" <strong>last name</strong>."});
	else alertField(ln,{id:"last_name"},true);
	if (!inputHasValue(a)) ok = alertField(a,{id:"age",message:"Please enter "+des+" <strong>age</strong>."});
	else alertField(a,{id:"age"},true);
	
	if (ok) manualSearchSuccess();
	
	return ok;
	}

function regOnSubmit(check_only,stream_check)
	{
	var f = $("#regForm");
	if (!check_only) f[0].submitted_once = true;
	var ok = true;
	
	var fn = $("[name='firstName']",f);
	var ln = $("[name='lastName']",f);
	var p = $("[name='password']",f);
	var cp = $("[name='confirmPassword']",f);
	var e = $("[name='email']",f);
	var g = $("[name='gender']",f);
	var bm = $("[name='birthMonth']",f);
	var bd = $("[name='birthDay']",f);
	var by = $("[name='birthYear']",f);
	var z = $("[name='zip']",f);

	if (fn.val() != fn[0].defaultValue) fn.val(fixName(fn.val()));
	if (ln.val() != ln[0].defaultValue) ln.val(fixName(ln.val()));
	//if (e.val() != e[0].defaultValue) e.val(fixEmail(e.val()));
	if (z.val() != z[0].defaultValue) z.val(fixZip(z.val()));

	if (f[0].submitted_once || (stream_check && fn[0].has_blurred))
		{
		if (!inputHasValue(fn)) ok = alertField(fn,{id:"first_name",message:"Please enter your <strong>first name</strong>."});
		else alertField(fn,{id:"first_name"},true);
		}
	if (f[0].submitted_once || (stream_check && ln[0].has_blurred))
		{
		if (!inputHasValue(ln)) ok = alertField(ln,{id:"last_name",message:"Please enter your <strong>last name</strong>."});
		else alertField(ln,{id:"last_name"},true);
		}

	if (p.length && p.is(":visible"))
		{
		if (f[0].submitted_once || (stream_check && p[0].has_blurred))
			{
			if (!inputHasValue(p)) ok = alertField(p,{id:"pass",message:"Please enter a password."});
			else if (p.val().length < 4 || p.val().length > 20) ok = alertField(p,{id:"pass",message:"Password must be between 4 and 20 characters in length."});
			else if (!isValidPassword(p.val())) ok = alertField(p,{id:"pass",message:"Password may contain only numbers, letters and underscores."});
			else alertField(p,{id:"pass"},true);
			}
		if (cp.length)
			{
			if (cp.is(":visible"))
				{
				if (f[0].submitted_once || (stream_check && cp[0].has_blurred))
					{
					if (cp.val() != p.val()) ok = alertField(cp,{id:"confirm_pass",message:"Passwords do not match."});
					else alertField(cp,{id:"confirm_pass"},true);
					}
				}
			else cp.val(p.val());
			}
		}
	
	if (f[0].submitted_once || (stream_check && e[0].has_blurred))
		{
		if (!inputHasValue(e)) ok = alertField(e,{id:"email",message:"Please enter your <strong>email</strong> address."});
		else if (!isValidEmail(e.val())) ok = alertField(e,{id:"email",message:"Please enter a valid <strong>email</strong> address."});
		else alertField(e,{id:"email"},true);
		}
	
	if (f[0].submitted_once || (stream_check && g[0].has_blurred))
		{
		if (g.attr("type") == "radio")
			{
			if (!g[0].checked && !g[1].checked) ok = alertField(g,{id:"gender",message:"Please select <strong>male</strong> or <strong>female</strong>."});
			else alertField(g,{id:"gender"},true);
			}
		else
			{
			if (!g.val()) ok = alertField(g,{id:"gender",message:"Please select <strong>male</strong> or <strong>female</strong>."});
			else alertField(g,{id:"gender"},true);
			}
		}
	
	if (f[0].submitted_once || (stream_check && by[0].has_blurred && bm[0].has_blurred && bd[0].has_blurred))
		{
		if (!by.val()) ok = alertField(by,{id:"birthdate",message:"Please select the <strong>year</strong> in which you were born."});
		else alertField(by,{},true);
		if (!bm.val()) ok = alertField(bm,{id:"birthdate",message:"Please select the <strong>month</strong> in which you were born."});
		else alertField(bm,{},true);
		if (!bd.val()) ok = alertField(bd,{id:"birthdate",message:"Please select the <strong>day</strong> on which you were born."});
		else alertField(bd,{},true);
		if (bm.val() && bd.val() && by.val()) alertField(by,{id:"birthdate"},true);
		}
	
	if (f[0].submitted_once || (stream_check && z[0].has_blurred))
		{
		if (!inputHasValue(z)) ok = alertField(z,{id:"zip",message:"Please enter your <strong>zip code</strong>."});
		else if (!strHasLengthOf(z.val(),[5,6,7,8,9,10])) ok = alertField(z,{id:"zip",message:"Please enter a <strong>valid US/Canadian zip code (no dashes)</strong>."});
		else alertField(z,{id:"zip"},true);
		}

	if (ok && !check_only)
		{
		if (p.length && !p.is(":visible")) p.remove();
		if (cp.length && !cp.is(":visible")) cp.remove();
		regFormSuccess();
		loadProcessingOverlay({loading_copy:"Processing...",bg_color:"#000000",bg_alpha:"85"});
		}

	return ok;
	}

function alertField(jobj,err,pass)
	{
	var err_elm = jobj.parents("form:first").find(".error."+err.id);
	if (pass)
		{
		jobj.removeClass("highlight");
		jobj.addClass("successful");
		if (err.id) err_elm.html("");
		if (err_elm.hasClass("dblock")) err_elm.fadeOut(300);
		return true;
		}
	else
		{
		jobj.removeClass("successful");
		jobj.addClass("highlight");
		err_elm.html(err.message);
		if (err_elm.hasClass("dblock")) err_elm.fadeIn(300);
		return false;
		}
	}

var reg_exp_bad_age_chars = new RegExp("[^0-9]","g");
var reg_exp_bad_name_chars = new RegExp("[^a-zA-Z\-\' ]","g");
var reg_exp_bad_email_chars = new RegExp("[^a-zA-Z0-9_@\+\-\.]","g");
var reg_exp_bad_zip_chars = new RegExp("[^a-zA-Z0-9]","g");
var reg_exp_bad_password_chars = new RegExp("[^a-zA-Z0-9_]","g");
var reg_exp_perimeter_spaces = new RegExp("^( )+|( )+$","g");
var reg_exp_consecutive_spaces = new RegExp(" +","g");

function fixAge(age)
	{
	var max = 120;
	age = age ? age+"" : "";
	age = age.substring(0,3);
	age = age.replace(reg_exp_bad_age_chars,"");
	if (age && age > max) age = age.substring(0,2);
	return age;
	}

function fixName(name)
	{
	name = name ? name+"" : "";
	name = name.replace(reg_exp_perimeter_spaces,"");
	name = name.replace(reg_exp_consecutive_spaces," ");
	name = name.replace(reg_exp_bad_name_chars,"");
	var lcase = name.toLowerCase();
	if (lcase == "firstname" || lcase == "lastname" || lcase == "theirfirstname" || lcase == "theirlastname") name = "";
	return name;
	}

function fixEmail(email)
	{
	email = email ? email+"" : "";
	return email.replace(reg_exp_bad_email_chars,"");
	}

function fixZip(zip)
	{
	zip = zip ? zip+"" : "";
	return zip.replace(reg_exp_bad_zip_chars,"");
	}

function isValidPassword(str)
	{
	if (typeof(str) != "string") return false;
	if (str.length < 4 || str.length > 20) return false;
	if (str.replace(reg_exp_bad_password_chars,"") != str) return false;
	return true;
	}

function isValidEmail(str)
	{
	if (!strContains(str,["@","."])) return false;
	if (reg_exp_bad_email_chars.test(str)) return false;
	return true;
	}

function inputHasValue(jobj)
	{
	if (!jobj.val() || (jobj.attr("type") != "hidden" && jobj.val() == jobj[0].defaultValue)) return false;
	return true;
	}

function strHasLengthOf(str,l_arr)
	{
	for (var i=0;i<l_arr.length;i++)
		{
		if (str.length == l_arr[i]) return true;
		}
	return false;
	}

function strContains(val,str_arr)
	{
	val = typeof(val) == "object" ? val.value : (val || "");
	for (var i=0;i<str_arr.length;i++)
		{
		if (val.indexOf(str_arr[i]) == -1) return false;
		}
	return true;
	}

function capitalize(str)
	{
	var words = str.split(" ");

	for (var i=0;i<words.length;i++)
		{
		if (words[i].toLowerCase() == "hs")
			{
			words[i] = "HS";
			continue;
			}
		var reg_exp_c = new RegExp("^([^a-zA-Z]*)([a-zA-Z]{1})(.*)","g");
		var w_arr = reg_exp_c.exec(words[i]);
		if (w_arr)
			{
			var first2 = (w_arr[2]+w_arr[3]).substr(0,2).toLowerCase();
			if (first2 == "mc" || first2 == "o'") words[i] = w_arr[1]+(w_arr[2].toUpperCase()+w_arr[3].charAt(0))+w_arr[3].charAt(1).toUpperCase()+w_arr[3].substr(2);
			else words[i] = w_arr[1]+w_arr[2].toUpperCase()+w_arr[3].toLowerCase();
			}
		}
	return words.join(" ");
	}

function cacheImage(url)
	{
	if (typeof("img_cache") != "object") img_cache = new Array();
	img_cache.push(new Image());
	img_cache[img_cache.length-1].src = url;
	}

cacheImage("http://a1.mylife.com/a/landa/i/processing_overlay_logo.gif");
cacheImage("http://a1.mylife.com/a/landa/i/processing_overlay_loader.gif");
function loadProcessingOverlay(params)
	{
	if (typeof(params) != "object") var params = {};
	var bg_color = params["bg_color"] || "#000000";
	var bg_alpha = Math.round((params["bg_alpha"] || 85)*1);
	var loading_copy = params["loading_copy"] || "Processing...";
	var window_height = getWidthHeightOfWindow().height;
	var d = getWidthHeightOfDocument();
	var c = getCenterOfScreen();
	$("body").append('<div id="processing_overlay-cont"><div id="processing_overlay-bg"></div><div id="processing_overlay"></div></div>');
	$("#processing_overlay-cont").css({"position":"absolute","left":"-10000px","top":"0px","z-index":"9999"});
	$("#processing_overlay-bg").css({"position":"absolute","left":"0px","top":"0px","background":bg_color});
	$("#processing_overlay-bg").css({"opacity":bg_alpha/100,"filter":"alpha(opacity="+bg_alpha+")"});
	$("#processing_overlay-bg").css({"width":d.width+"px","height":(d.height < window_height ? window_height : d.height)+"px"});
	$("#processing_overlay").html('<img src="http://a1.mylife.com/a/landa/i/processing_overlay_logo.gif" alt="MyLife.com" width="96" height="58" /><br /><img src="http://a1.mylife.com/a/landa/i/processing_overlay_loader.gif" alt="loading..." width="128" height="15" /><br />'+loading_copy);
	$("#processing_overlay").css({"position":"absolute"});
	var i_xy = {
		x:c.x-$("#processing_overlay").width()/2,
		y:c.y-$("#processing_overlay").height()/2
		};
	if (i_xy.y < 0) i_xy.y = 0;
	$("#processing_overlay").css({"left":i_xy.x+"px","top":i_xy.y+"px"});
	$("#processing_overlay-cont").css({"display":"none","left":"0px"});
	$("#processing_overlay-cont").fadeIn(500);
	}

function genderOnChange(inp,dont_animate)
	{
	var m = $("#maiden");
	var i = $(inp);
	if (i.val() == "2")
		{
		if (dont_animate) m.css("display","block");
		else m.fadeIn(300);
		}
	else
		{
		if (dont_animate) m.css("display","none");
		else m.fadeOut(300);
		}
	}

function maximizeWindow(relocate,set_width,set_height)
	{
	set_width = set_width || 9999;
	set_height = set_height || 9999;
	if (screen.availWidth || screen.width)
		{
		var max_width = screen.availWidth || screen.width;
		var max_height = screen.availHeight || screen.height;
		var new_width = (!set_width || max_width < set_width) ? max_width : set_width;
		var new_height = (!set_height || max_height < set_height) ? max_height : set_height;
		if (window.resizeTo) window.resizeTo(new_width,new_height);
		else if (window.outerWidth)
			{
			window.outerWidth = new_width;
			window.outerHeight = new_height;
			}
		}
	if (relocate)
		{
		if (window.moveTo) window.moveTo(0,0);
		else if (window.screenX)
			{
			window.screenX = 0;
			window.screenY = 0;
			}
		}
	}

function fireRegOpenedPixel()
	{
	if (typeof(global_regopenedpx) == "undefined" && !$_GET["debug"])
		{
		var px = new Image();
		px.src = "http://r.casalemedia.com/j.gif?u=123830&s=2";
		global_regopenedpx = true;
		}
	}

function stop_tab(e)
	{
	e = e || window.event;
	var key_code = e.which || e.keyCode;
	if (key_code == 9) return false;
	}

function getWidthHeightOf(element)
	{
	var e = $(element);
	return {width:e.width(),height:e.height()};
	}

function getWidthHeightOfWindow()
	{
	return {width:$(window).width(),height:$(window).height()};
	}

function getWidthHeightOfDocument()
	{
	return {width:$(document).width(),height:$(document).height()};
	}

function getCenterOfScreen()
	{
	var scrollHeight = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
	var w_wh = getWidthHeightOfWindow();
	var x = w_wh.width/2;
	var y = w_wh.height/2+scrollHeight;
	return {x:x,y:y};
	}

function selectOptionWithValue(sel,val)
	{
	for (var i=0;i<sel.length;i++) sel[i].selected = false;
	for (var i=0;i<sel.length;i++)
		{
		if (sel[i].value == val)
			{
			sel[i].selected = true;
			return sel[i];
			}
		}
	return null;
	}

function getURLVars(from_str)
	{
	if (from_str) var url = from_str;
	else var url = ((typeof(window.location) == "string") ? window.location : window.location.href) || "";
	var var_string = url.split("?")[1] || "";
	var var_pairs = var_string.split("&");
	var get_object = new Object();
	for (var i=0;i<var_pairs.length;i++)
		{
		var pair = var_pairs[i].split("=");
		if (pair.length == 2) get_object[pair[0]] = pair[1];
		}
	return get_object;
	}
$_GET = getURLVars();

function inputOnBlur(inp)
	{
	var i = $(inp);
	i.removeClass("current");
	i[0].has_blurred = true;
	if (!i.val() && i[0] && i[0].defaultValue)
		{
		i.val(i[0].defaultValue);
		i.addClass("example");
		}
	}

function inputOnFocus(inp)
	{
	var i = $(inp);
	i.addClass("current");
	i[0].has_focused = true;
	if (i[0] && i.val() == i[0].defaultValue)
		{
		i.val("");
		i.removeClass("example");
		}
	}

function assignDefaultValue(inp,default_value)
	{
	var i = $(inp);
	i.val(default_value);
	i[0].defaultValue = default_value;
	i.addClass("example");
	}

function applyFormEventHandlers()
	{
	__reg_streamcheck = typeof(__reg_streamcheck) != "undefined" ? __reg_streamcheck : true;
	
	var relevants = $("#psForm [type='text'],#wsfyForm [type='text'],#regForm [type='text'],#regForm [type='password'],#regForm select");
	relevants.bind("focus",function()
		{
		inputOnFocus(this);
		});
	relevants.bind("blur",function()
		{
		inputOnBlur(this);
		});
	
	$("#psForm [type='text']").bind("blur",function()
		{
		if ($("#psForm")[0].submitted_once) psOnSubmit();
		});
	$("#wsfyForm [type='text']").bind("blur",function()
		{
		if ($("#wsfyForm")[0].submitted_once) wsfyOnSubmit();
		});
	var rform = $("#regForm");
	rform.find("[type='text'],[type='password'],select,[type='radio']").bind("blur",function()
		{
		if ($("#regForm")[0].submitted_once) regOnSubmit(true);
		else if (__reg_streamcheck) regOnSubmit(true,true);
		});
	rform.find("select").bind("change",function()
		{
		if ($("#regForm")[0].submitted_once) regOnSubmit(true);
		else if (__reg_streamcheck) regOnSubmit(true,true);
		});
	rform.find("select[name='gender']").bind("change",function()
		{
		genderOnChange(this);
		});
	rform.find("[name='gender'][type='radio']").bind("click",function()
		{
		genderOnChange(this);
		if ($("#regForm")[0].submitted_once) regOnSubmit(true);
		else if (__reg_streamcheck) regOnSubmit(true,true);
		});
	}

function qa_ids()
	{
	var wf = $("#wsfyForm");
	$("[name='firstName']",wf).attr("id","searchFName");
	$("[name='lastName']",wf).attr("id","searchLName");
	$("[name='age']",wf).attr("id","searchAge");
	$("[type='image']:last, [type='submit']:last",wf).attr("id","searchSubmit");

	var pf = $("#psForm");
	$("[name='searchFirstName']",pf).attr("id","searchFName");
	$("[name='searchLastName']",pf).attr("id","searchLName");
	$("[name='searchAge']",pf).attr("id","searchAge");
	$("[type='image']:last, [type='submit']:last",pf).attr("id","searchSubmit");
	
	var rf = $("#regForm");
	$("[name='firstName']",rf).attr("id","regFName");
	$("[name='lastName']",rf).attr("id","regLName");
	$("[name='email']",rf).attr("id","regEmail");
	$("[name='gender']",rf).attr("id","regGender");
	$("[name='maidenName']",rf).attr("id","regMName");
	$("[name='birthMonth']",rf).attr("id","regBdayMon");
	$("[name='birthDay']",rf).attr("id","regBdayDay");
	$("[name='birthYear']",rf).attr("id","regBdayYear");
	$("[name='zip']",rf).attr("id","regZipcode");
	$("[type='image']:last, [type='submit']:last",rf).attr("id","regSubmit");
	}

function setGender(to,hide)
	{
	if (to == 1) to = "m";
	else if (to == 2) to = "f";
	var gval = {"m":1,"f":2};
	var g = $("#regForm [name='gender']");
	if (typeof(global_custom_radio_controller) != "undefined" && global_custom_radio_controller && typeof(global_custom_radio_controller.setState) == "function")
		{
		global_custom_radio_controller.setState(to);
		}
	else if (g.attr("type") == "radio")
		{
		for (var i=0;i<g.length;i++)
			{
			if (g[i].value == gval[to]) $(g[i]).click();
			}
		}
	else
		{
		g.val(gval[to]);
		genderOnChange(g[0]);
		}
	if (hide) $("#gender").css("display","none");
	}

function insertQueryStringVarsIntoRegForm()
	{
	var rf = $("#regForm");
	var names = "firstName|lastName|searchFirstName|searchLastName|";
	var ages = "age|searchAge|";
	for (var k in $_GET)
		{
		if ($_GET[k])
			{
			var val = $_GET[k];
			if (names.indexOf(k+"|") != -1) val = fixName(val);
			else if (ages.indexOf(k+"|") != -1) val = fixAge(val);
			if (val)
				{
				var jelm = $("[name='"+k+"']",rf);
				if (k == "gender") setGender(val);
				else jelm.val(val);
				}
			}
		}
	}

jQuery.fn.swap = function(b)
	{
	b = jQuery(b)[0];
	var a = this[0],
	a2 = a.cloneNode(true),
	b2 = b.cloneNode(true),
	stack = this;

	a.parentNode.replaceChild(b2,a);
	b.parentNode.replaceChild(a2,b);

	stack[0] = a2;
	return this.pushStack(stack);
	};

function strReplaceInChildren(haystack,replace,needle,case_insensitive)
	{
	var reg_exp;
	if (typeof(needle) == 'string') reg_exp = new RegExp(needle,'g'+(case_insensitive ? 'i' : ''));
	else reg_exp = needle;
	var children = haystack.find('*');
	var replaced = 0;
	for (var i=0;i<children.length;i++)
		{
		var child = $(children[i]);
		//if (!child.find("*").length && reg_exp.test(child.html()))
		if (reg_exp.test(child.html()))
			{
			child.html(child.html().replace(reg_exp,replace));
			//hack fix...
			child.find('[name="'+replace+'"]').attr('name',needle);
			child.find('.Postal').addClass(needle);
			replaced++;
			}
		}
	return replaced;
	}

function countryChanges()
	{
	if ($_GET["co"])
		{
		if ($_GET["co"].toLowerCase() == "international")
			{
			var forms = $('form');
			for (var i=0;i<forms.length;i++)
				{
				var f = $(forms[i]);
				var bd = f.find("[name='birthDay']"), bm = f.find("[name='birthMonth']");
				if (bd.length && bm.length) bd.swap(bm);
				strReplaceInChildren(f,'Postal Code','zip code',true);
				strReplaceInChildren(f,'Postal Code','zip',true);
				}
			}
		}
	}

$(function()
	{
	applyFormEventHandlers();
	qa_ids();
	insertQueryStringVarsIntoRegForm();
	countryChanges();
	pageLoadSuccess();
	
	/*
	if (parent && typeof($_GET['abid']) == 'undefined' && global_client_ip == '208.147.48.67' && $_GET['id'] == 'seo-ps')
		{
		window.location = window.location.href + (window.location.href.indexOf('?') == -1 ? '?' : '&') + 'abid=b&debug=1';
		}
	*/
	/*
	if (parent && !$_GET['abid'] && parent.$_GET && parent.$_GET['debug'] && parent.$_GET['abid'] && !$_GET['debug'] == 2)
		{
		window.location = window.location.href + (window.location.href.indexOf('?') == -1 ? '?' : '&') + 'abid='+parent.$_GET['abid']+'&debug=2';
		}
	*/
	});

if (typeof(frame_buster) == "string" && parent.frames.length > 0)
	{
	var url = typeof(document.url) == "string" ? document.url : (typeof(document.location) == "string" ? document.location : (typeof(window.location) == "string" ? window.location : window.location.href));
	if (top.location.replace) top.location.replace(url);
	else if (top.location.assign) top.location.assign(url);
	else top.location.href = url;
	}