var idselectquestions;
var idGirlsglobal;
var strchatType;
var strsecretBChat;
var globalnameGirl;
var globaluserType;
var strStatusSwf;
var strStatusRegisterSwf;
var strMessageRegisterSwf;
var stremailregister;
var strpasswordregister;
var strStatusForgotPasswordSwf;
var strmessageForgotPassword;
var strStatusChangePasswordSwf;
var strmessageChangePassword;
var strStatusChangeQnA;
var strmessageChangeQnA;
var strStatusUpdateDaughterPassword;
var strmessageUpdateDaughterPassword;
var strStatusUpdateDaughterQnA;
var strmessageUpdateDaughterQnA;
var strStatusAddDaughter;
var strmessageAddDaughter;
var successGobal;
var strStatusListDaughters;
var strmessageListDaughters;


var bLoggedIn="";
var pendingJsCallBack='';
// JavaScript Document
var checkField = function(selector) {
var isEmpty=false;
var str = $(selector).attr("value");
if((str!=null)||(str!="")){
var str = $.trim(str).toLowerCase();
}
if((str==null)||(str=="")){
isEmpty=true;
}
return isEmpty;
};

var checkSelect = function(selector) {
var isDefault=false;
if(($(selector).attr("value")=="0")||($(selector).attr("value")=="0")){
isDefault=true;
}
return isDefault;
};

var checkMailFormat = function(mailString){
var wrongMailFormat=false;
if(!checkMail($(mailString).attr("value"))){
wrongMailFormat=true;
}
return wrongMailFormat;
};

var checkMail = function(mailToCheck){
var s = "";
//var filter=/^[A-Za-z0-9][A-Za-z0-9_.-]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.-]+[A-za-z]$/;
//var filter=/^.+@.+\..{2,3}$/;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
//---
if (typeof(mailToCheck) == "object") {
s = mailToCheck.value.toLowerCase();
}else if (typeof(mailToCheck) == "string") {
s = mailToCheck.toLowerCase();
}else {
return false;
}
//---
if (s.length == 0 ) {
return false;
} else if (filter.test(s)) {
return true;
}
//---	
return false;
};



function getSecureDomain() {
var sDomain = document.domain;
var secureDomain = "https://secure.barbiegirls.com";
if ( sDomain.indexOf("staging.barbiegirls.com")  >= 0 ) { secureDomain="https://secure.staging.barbiegirls.com"}
else if ( sDomain.indexOf("beta.barbiegirls.com")  >= 0 ) { secureDomain="https://beta.barbiegirls.com"}
else if ( sDomain.indexOf("127.0.0.1")  >= 0 ) { secureDomain="https://127.0.0.1:8443"}
else if ( sDomain.indexOf("10.0.1.148") >= 0 ) { secureDomain="https://10.0.1.148/Mattel"}
else if ( sDomain.indexOf("10.1.1.41")  >= 0 ) { secureDomain="https://10.1.1.41/Mattel"}
else if ( sDomain.indexOf("mattel.studiocom.com")  >= 0 ) { secureDomain="https://mattel.studiocom.com/Mattel"}
else if ( sDomain.indexOf("www")  >= 0 ) { secureDomain="https://secure.barbiegirls.com" }
return secureDomain;
}


var xmlstr="";
var webService = function(service,urlString){		
var str=Array();
var i=0;
$.ajax({
type:"POST",
//type:"GET",			
//url:service+'?'+urlString,
url:service,
datatype:"xml",
data:urlString,			
async:false,
cache:false,
success: function(msg){
xmlstr = msg;
}
});
};
var htmlstr="";
var webServiceHtml = function(service,urlString){		
var str=Array();
var i=0;
$.ajax({
type:"POST",
//type:"GET",			
//url:service+'?'+urlString,
url:service,
datatype:"html",
data:urlString,			
async:false,
cache:false,
success: function(msg){
htmlstr=msg;
}
});
};

var parseXml = function(xmltag){
//		var xmltexparent=$.trim(xmltag);
var str=Array();
var i=0;
$(xmlstr).find(xmltag).each(function(){
str[i]=$(this).text();
i++;
});
return str;
};

var parseXmlSwf = function(xmltag,xmlstrString){
		var xmlObject =convertStringToXML(xmlstrString.toString());
		
		var str=Array();
		var i=0;
		$(xmlObject).find(xmltag).each(function(){
			str[i]=$(this).text();
		 i++;
	});

	return str;
};


function convertStringToXML(xmlstrString)
	{
	var xmlobject;
	if (window.ActiveXObject)
	{
		xmlObj=new ActiveXObject("Microsoft.XMLDOM");
		xmlObj.async="false";
		xmlObj.loadXML(xmlstrString);
		if(xmlObj.documentElement != null)
			xmlobject = xmlObj.documentElement;		
		return xmlobject;
	}
	else
		var xmlobject = (new DOMParser()).parseFromString(xmlstrString, "text/xml");
		return xmlobject;
	}



function logicalShowmydrUrl(success)
		{
	if (success)
		{
			$(".myparentaccount").css("background-image", "url(IMG/parents/spacer.gif)");
			successGobal =true;
			$("#img").css("background-image","url(IMG/parents/img_parent.gif)");
			$("#img").css("background-repeat","no-repeat");
			$(".myparentaccount").css("cursor","pointer");
			$("#menu_text_active").css("display","block");	
			$("#menu_text_inactive").css("display","none");	
		

			$("#editdaughtercaseclosed").css("display","none");
			$("#editdaughtercaseBanned").css("display","none");
			$("#contenidoSafety").css("display","none");
			$("#contenidoAccount").css("display","block");
			$("#contenidoGeneralInfo").css("display","none");
			$("#contenidoHome").css("display","none");
			$(".parentHome").css("background-image", "url(IMG/parents/tab_01.gif)");
			$(".generalParentInfo").css("background-image", "url(IMG/parents/tab_03.gif)");
			$(".safetyInfomation").css("background-image", "url(IMG/parents/tab_04.gif)");
			$("#editdaughtercase3").css("display","none");
			$("#editdaughtercase2").css("display","none");				
			$("#editdaughtercase1").css("display","none");					
			$("#editdaughtercase4").css("display","none");	
			tabParenthome=true;
			tabParentAccountDetails=false;
			tabParentMessageParents=true;
			tabParentOnlineSafety=true;

			fillDaughter('3')
			
			
			$('#inputinfoadddaughter').css("display","block");				
			$('#adddaughterpopup').modal();
			$('#adddaughterpopup').css("height","350px");
			$('#adddaughterpopup').css("width","575px");
			$('#adddaughterpopup').css("padding-left","55px");
			//fillDaughter('2')
		}
		else
		{
			loggedexpire();	
		}
		
	}


function logicalShowmydrUrlAccount(success)
		{
	if (success)
		{
			$(".myparentaccount").css("background-image", "url(IMG/parents/spacer.gif)");
			successGobal =true;
			$("#img").css("background-image","url(IMG/parents/img_parent.gif)");
			$("#img").css("background-repeat","no-repeat");
			$(".myparentaccount").css("cursor","pointer");
			$("#menu_text_active").css("display","block");	
			$("#menu_text_inactive").css("display","none");	
		

			$("#editdaughtercaseclosed").css("display","none");
			$("#editdaughtercaseBanned").css("display","none");
			$("#contenidoSafety").css("display","none");
			$("#contenidoAccount").css("display","block");
			$("#contenidoGeneralInfo").css("display","none");
			$("#contenidoHome").css("display","none");
			$(".parentHome").css("background-image", "url(IMG/parents/tab_01.gif)");
			$(".generalParentInfo").css("background-image", "url(IMG/parents/tab_03.gif)");
			$(".safetyInfomation").css("background-image", "url(IMG/parents/tab_04.gif)");
			$("#editdaughtercase3").css("display","none");
			$("#editdaughtercase2").css("display","none");				
			$("#editdaughtercase1").css("display","none");					
			$("#editdaughtercase4").css("display","none");	
			tabParenthome=true;
			tabParentAccountDetails=false;
			tabParentMessageParents=true;
			tabParentOnlineSafety=true;

			fillDaughter('3')
			
			
			/*$('#inputinfoadddaughter').css("display","block");				
			$('#adddaughterpopup').modal();
			$('#adddaughterpopup').css("height","350px");
			$('#adddaughterpopup').css("width","575px");
			$('#adddaughterpopup').css("padding-left","55px");*/
			//fillDaughter('2')
		}
		else
		{
			loggedexpire();	
		}
		
	}

	
	function doRefresh(success) {
	if (success)
		{
			 successGobal=true;
			 $("#loggedwindows").css("display","none");
			 $("#contenTotal").css("display","block");
			 $("#box_area").css("display","none");
			 $("#box_area2").css("display","block");
			 $("#tit_area1_login").css("display","block");
			 $("#box_home_login").css("display","block");	
			 $("#box_home").css("display","none");	
			 $("#tit_area1").css("display","none");				 
			 $("#title_log_out").css("display","block");

			$("#menu_text_active").css("display","block");	
			$("#menu_text_inactive").css("display","none");	
			
			var temlocal3=document.getElementById("content_reload3").innerHTML; 
			document.getElementById("content_reload3").innerHTML ='';
			document.getElementById("content_reload3").innerHTML=temlocal3;		
			
			$("#img").css("background-image","url(IMG/parents/img_home.gif)");
			$(".generalParentInfo").css("background-image", "url(IMG/parents/tab_03.gif)");
			$(".safetyInfomation").css("background-image", "url(IMG/parents/tab_04.gif)");
			$(".myparentaccount").css("background-image", "url(IMG/parents/tab_02_over.gif)");			
			
			var strdr = window.location.search.substring(1);		
			var contentdr = strdr.split("=");
			if(contentdr[0]!="" && contentdr[0] =="action" && contentdr[1]=="ad")
			{
				logicalShowmydrUrl(true);
				$("#listgirls").css("display","none");			
			}
			else if(contentdr[0]!="" && contentdr[0] =="action" && contentdr[1]=="accdet")			
			{
				logicalShowmydrUrlAccount(true);
			}
		}
		else
		{

			$("#box_area").css("display","block");
			$("#tit_area1_login").css("display","none");
			$("#box_home_login").css("display","none");	
			$("#box_home").css("display","block");	
			$("#tit_area1").css("display","block");		
			$("#menu_text_active").css("display","none");	
			$("#menu_text_inactive").css("display","block");	
			

			var temlocal=document.getElementById("content_reload").innerHTML; 
			document.getElementById("content_reload").innerHTML ='';
			document.getElementById("content_reload").innerHTML=temlocal;
			
			/*var temlocal2=document.getElementById("content_reload2").innerHTML; 
			document.getElementById("content_reload2").innerHTML ='';
			document.getElementById("content_reload2").innerHTML=temlocal2;			*/

			var temlocal3=document.getElementById("content_reload3").innerHTML; 
			document.getElementById("content_reload3").innerHTML ='';
			document.getElementById("content_reload3").innerHTML=temlocal3;			
			$("#img").css("background-image","url(IMG/parents/img_home.gif)");
			$(".generalParentInfo").css("background-image", "url(IMG/parents/tab_03.gif)");
			$(".safetyInfomation").css("background-image", "url(IMG/parents/tab_04.gif)");
			$(".myparentaccount").css("background-image", "url(IMG/parents/tab_02_over.gif)");
			successGobal=false;
			
			var strdr = window.location.search.substring(1);		
			var contentdr = strdr.split("=");
			if(contentdr[0]!="" && contentdr[0] =="action" && contentdr[1]=="ad")
			{
				logicalShowmydrUrl(false);
			}	
			else if(contentdr[0]!="" && contentdr[0] =="action" && contentdr[1]=="accdet")			
			{
				logicalShowmydrUrlAccount(false);
			}

		}
		clearBox();
	}


function processIsLoggedInResponse(dataXml)
{
	bLoggedIn =	parseXmlSwf("isLoggedIn",dataXml);
	
	bLoggedIn = bLoggedIn == "true"? true : false;
	
	
	successGobal=bLoggedIn;

	if(pendingJsCallBack=='1')
	{
		doRefresh(bLoggedIn);
	}	
	else if(pendingJsCallBack=='2')
		{
		  fillDaughterlogin(bLoggedIn);
		}
	else
	{
		pendingJsCallBack(successGobal);
	}
	//pendingJsCallBack(bLoggedIn);
}

var isValidSesion = function(doCallBack){
	
	pendingJsCallBack = doCallBack; 
	isValidSesionFormSwf();
	
};


 function isValidSesionFormSwf()
{
	$('#swfGatewayParentList').replaceWith("<div  id='swfGatewayParentList'></div>")
	$('#swfGatewayParentList').flash(
	{ 
		src: 'SWF/parental/parentIsLoggedIn.swf',
		width: 1,
		height: 1,
		flashvars: {sURL:environment+"/pi/parentIsLoggedIn.do"
	}
	},
		{ version: 8 }
	);

}




function selectvaluequestions(strid)
{
idselectquestions =strid;

}


/*function deliveryparametersIslogin(success)
	{
		
	
	}*/
function deliveryparameters(idGirl, nameGirl,struserType)
{
	//isValidSesion(deliveryparametersIslogin);
		globalnameGirl=nameGirl;
		globaluserType=struserType;
		idGirlsglobal =idGirl;
		$.showLoader();	
	
		parentDaughterInfoFormSwf(idGirlsglobal);
	
	
		
}

function sendparentemaillogin(success)
{
	if (success)
	{
		successGobal=true;
		if (checkField("#txtpopupparentemail") || checkField("#txtpopupparentemail2"))
			{
			$("#contenterrors").css("display","block");
			$("#textmessageclient").css("display","none");
			$("#textmessageserver").css("display","none");
			$("#textmessageclientone").css("display","none");
			$("#textmessageclienttwo").css("display","block");
			}
		else if(checkMailFormat("#txtpopupparentemail") || checkMailFormat("#txtpopupparentemail2"))
			{
				successGobal =false;
			$("#contenterrors").css("display","block");
			$("#textmessageclient").css("display","block");
			$("#textmessageclientone").css("display","none");
			$("#textmessageserver").css("display","none");
			$("#textmessageclienttwo").css("display","none");
			}
		else if($("#txtpopupparentemail").attr('value')!= $("#txtpopupparentemail2").attr('value'))
			{
			$("#contenterrors").css("display","block");
			$("#textmessageclient").css("display","none");
			$("#textmessageclientone").css("display","block");
			$("#textmessageserver").css("display","none");
			$("#textmessageclienttwo").css("display","none");
			}
		else 
			{
			$.showLoader();	
			changeEmailParentFormSwf($('#txtpopupparentemail').attr('value'));
			}
	}
	else
	{
	successGobal =false;
	loggedexpire();				
	}	
}

function sendparentemail()
{
	isValidSesion(sendparentemaillogin);	
}


function parentchangepasswordlogin(success)
{
	if (success)
	{					
		successGobal=true;
		if (checkField("#currentpasswordparent") || checkField("#newpasswordparent") || checkField("#retypenewpasswordparent"))
		{
		$("#errorpasswordparentchange").css("display","block");
		$("#changepaswordparentsone").css("display","none");
		$("#changepaswordparentstwo").css("display","none");
		$("#changepaswordparentsThree").css("display","block");		
		$("#changepaswordparentsfor").css("display","none");
		$("#changepaswordparentssix").css("display","none");
		}
		else if ($("#newpasswordparent").attr('value') != $("#retypenewpasswordparent").attr('value'))
		{
		$("#errorpasswordparentchange").css("display","block");
		$("#changepaswordparentsfor").css("display","block");
		$("#changepaswordparentssix").css("display","none");
		$("#changepaswordparentsone").css("display","none");
		$("#changepaswordparentstwo").css("display","none");
		$("#changepaswordparentsThree").css("display","none");
		}
		else if ($("#newpasswordparent").attr("value").length <6 || $("#retypenewpasswordparent").attr("value").length <6)
		{
		$("#errorpasswordparentchange").css("display","block");
		$("#changepaswordparentsfor").css("display","none");
		$("#changepaswordparentssix").css("display","block");
		$("#changepaswordparentsone").css("display","none");
		$("#changepaswordparentstwo").css("display","none");
		$("#changepaswordparentsThree").css("display","none");
		}
		else
		{
			$.showLoader();
			ChangePasswordParentFormSwf($('#currentpasswordparent').attr('value'),$('#newpasswordparent').attr('value'))
		}
	}
	else
	{
		successGobal =false;
		loggedexpire();				
	}
}

function parentchangepassword()
{
	isValidSesion(parentchangepasswordlogin);	
	
	
}

function aughterchangequestionlogin(success)
{
	if (success)
	{	
		successGobal=true;
		var optionSelectedQuestionDaughter = $("#selectSecretQuestionDaughter").selectedValues();  //get value from combo Secret Question
		if(optionSelectedQuestionDaughter==0)
		{
		$("#errodupdatequetiondaughter").css("display","block");
		$("#errodupdatequetiondaughtersecretanswer").css("display","none");	
		$("#errodupdatequetiondaughterserver").css("display","none");
		$("#errodupdatequetiondaughterminleng").css("display","none");
		}	
		else if(checkField("#txtsecretanswerdaughter"))
		{
		$("#errodupdatequetiondaughter").css("display","none");
		$("#errodupdatequetiondaughtersecretanswer").css("display","block");
		$("#errodupdatequetiondaughterserver").css("display","none");
		$("#errodupdatequetiondaughterminleng").css("display","none");
		}
		else if($("#txtsecretanswerdaughter").attr("value").length<4)
		{
		$("#errodupdatequetiondaughter").css("display","none");
		$("#errodupdatequetiondaughtersecretanswer").css("display","none");
		$("#errodupdatequetiondaughterserver").css("display","none");
		$("#errodupdatequetiondaughterminleng").css("display","block");
		}
		else
		{
		$.showLoader();
		/*CHANGE EMAIL ADDRESS PARENT*/
		UpdateDaughterQnAFormSwf(idGirlsglobal,optionSelectedQuestionDaughter,$('#txtsecretanswerdaughter').attr('value'))
		
		}
	}
	else
	{
		successGobal =false;
	loggedexpire();
	}
		
}

function aughterchangequestion()
{
	isValidSesion(aughterchangequestionlogin);
	

}

function registerparent()
{

var optionSelected = $("#selectSecretQuestion").selectedValues();  //get value combo of Secret Question

	if(checkField("#txtregisterparentemail"))
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");		
	$("#errorregistrationpasswordRequired").css("display","none");
	$("#errorregistrationemailRequired").css("display","block");	
	$("#errorregistrationquetionRequired").css("display","none");
	$("#errorregistrationquetionminLen").css("display","none");
	
	}
	else if(checkMailFormat("#txtregisterparentemail"))	//email format and lenght
	{
	$("#errorregistrationemail").css("display","block");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");		
	$("#errorregistrationpasswordRequired").css("display","none");
	$("#errorregistrationemailRequired").css("display","none");	
	$("#errorregistrationquetionRequired").css("display","none");
	$("#errorregistrationquetionminLen").css("display","none");
	}
	
	else if(checkField("#txtregisterparentpassword") || checkField("#txtregisterparentpasswordagain"))
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");	
	$("#errorregistrationpasswordRequired").css("display","block");
	$("#errorregistrationemailRequired").css("display","none");	
	$("#errorregistrationquetionRequired").css("display","none");	
	$("#errorregistrationquetionminLen").css("display","none");
	
	}
	else if($("#txtregisterparentpassword").attr("value").length <6||$("#txtregisterparentpasswordagain").attr("value").length <6)	//password valid and number of characteres
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","block");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");				
	$("#errorregistrationpasswordRequired").css("display","none");
	$("#errorregistrationemailRequired").css("display","none");
	$("#errorregistrationquetionRequired").css("display","none");	
	$("#errorregistrationquetionminLen").css("display","none");
	}
	else if ($('#txtregisterparentpassword').attr('value')!=$('#txtregisterparentpasswordagain').attr('value'))	//password match
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","block");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");
	$("#errorregistrationpasswordRequired").css("display","none");	
	$("#errorregistrationemailRequired").css("display","none");		
	$("#errorregistrationquetionRequired").css("display","none");
	$("#errorregistrationquetionminLen").css("display","none");
	}
	else if(optionSelected==0)	//secret question
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","block");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");
	$("#errorregistrationpasswordRequired").css("display","none");	
	$("#errorregistrationemailRequired").css("display","none");	
	$("#errorregistrationquetionRequired").css("display","none");
	$("#errorregistrationquetionminLen").css("display","none");
	}
	else if(checkField("#txtregisterparentsecretquestion"))
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");
	$("#errorregistrationpasswordRequired").css("display","none");	
	$("#errorregistrationemailRequired").css("display","none");			
	$("#errorregistrationquetionRequired").css("display","block");	
	$("#errorregistrationquetionminLen").css("display","none");
	
	}
	
	else if($("#txtregisterparentsecretquestion").attr("value").length<4 )
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationfields").css("display","none");
	$("#errorregistrationpasswordRequired").css("display","none");	
	$("#errorregistrationemailRequired").css("display","none");	
	$("#errorregistrationquetionRequired").css("display","none");	
	$("#errorregistrationquetionminLen").css("display","block");	
	
	}
	else if (checkField("#txtregistrationparentscreenname") || checkField("#txtregistrationparentpassword"))	//daughter’s Barbie Girls
	{
	$("#errorregistrationemail").css("display","none");
	$("#errorregistrationpasswordminortoseven").css("display","none");
	$("#errorregistrationpasswordmatch").css("display","none");
	$("#errorregistrationquetion").css("display","none");
	$("#errorregistrationinformation").css("display","none");
	$("#errorregistrationfields").css("display","block");			
	$("#errorregistrationinformationtermsconditions").css("display","none");
	$("#errorregistrationpasswordRequired").css("display","none");		
	$("#errorregistrationemailRequired").css("display","none");		
	$("#errorregistrationquetionRequired").css("display","none");	
	$("#errorregistrationquetionminLen").css("display","none");
	}
	else
	{
		if (document.registrationparents.yourdaughtername.checked == false)
		{
			$("#errorregistrationemail").css("display","none");
			$("#errorregistrationpasswordminortoseven").css("display","none");
			$("#errorregistrationpasswordmatch").css("display","none");
			$("#errorregistrationquetion").css("display","none");
			$("#errorregistrationinformation").css("display","none");
			$("#errorregistrationfields").css("display","none");			
			$("#errorregistrationinformationtermsconditions").css("display","block");
			$("#errorregistrationpasswordRequired").css("display","none");		
			$("#errorregistrationemailRequired").css("display","none");		
			$("#errorregistrationquetionRequired").css("display","none");	
			$("#errorregistrationquetionminLen").css("display","none");
		}
	
		$.showLoader();	
		stremailregister = $('#txtregisterparentemail').attr('value');
		strpasswordregister =$('#txtregisterparentpassword').attr('value');
		var idquestions = optionSelected;
		var strsanswer = $('#txtregisterparentsecretquestion').attr('value');
		var strdScreenName = $('#txtregistrationparentscreenname').attr('value');
		var strdPassword = $('#txtregistrationparentpassword').attr('value');

		registerParentFormSwf(stremailregister,strpasswordregister,idquestions,strsanswer,strdScreenName,strdPassword,document.registrationparents.yourdaughterpassword.checked,document.registrationparents.yourdaughtername.checked);
		$.hideLoader();
	}
}

function adddaugterlistlogin(success)
{
	if (success)
	{
	successGobal=true;
		//extenttimecookie();	
		if (checkField("#txtuserpassworddaughter") || checkField("#txtusernamedaughter"))
		{
		$("#erroraddaccount").css("display","block");
		$("#erroraddaccountserver").css("display","none");
		}
		else
		{
		$.showLoader();
		//var strToken = getCookieValue("MattelParentalInterfaceInfo");	//get value the cookie
		addDaughterFormSwf($('#txtusernamedaughter').attr('value'),$('#txtuserpassworddaughter').attr('value'));
		}
	}
	/*webService("pi/parentAddDaughter.do","dScreenName="+$('#txtusernamedaughter').attr('value')+"&dPassword="+$('#txtuserpassworddaughter').attr('value'));
	strstatus = parseXml("status");
	
	var strstatus = parseXml("status");
	var strmessage   = parseXml("message");
	
	if(strstatus[0] =="success")
	{
	$.modal.impl.close(true);
	fillDaughter('2')
	
	$('#adddaughterpopup').modal();
	$('#inputinfoadddaughter').css("display","none");
	$('#confirmationdaughter').css("display","block");
	$('#adddaughterpopup').css("padding-left","55px");
	$.hideLoader();
	
	var toppx = (toppx+100);
	var toppx1= (toppx1+0.1);
	
	$('#float_fix1').css("padding-top",toppx+"px");
	$('#little_box').css("padding-top",toppx1+"px");
	}
	else{
	$.hideLoader();
	$("#erroraddaccount").css("display","none");
	$("#erroraddaccountserver").replaceWith("<div class='cont_err_pp' id='erroraddaccountserver'><span class='txt_ttl_err_pp'>"+strmessage[0]+"</span></div>");
	}
	}
	}
	else
	{
	successGobal=false;
	loggedexpire();
	}*/
	
}



function adddaugterlist()
{
	isValidSesion(adddaugterlistlogin);
}

function daughterchangepasswordlogin(success)
{
	if (success)
	{		
		successGobal=true;
		if (checkField("#changedaughtercurrentpassword") || checkField("#changedaughtercurrentnewpassword") || checkField("#changedaughterretypecurrentnewpassword"))
		{
		$("#errorchangepasswordstep1").css("display","block");
		$("#messagecheckfields").css("display","block");
		$("#errorchangepasswordstep1client").css("display","none");			 
		$("#errorchangepasswordcomparate").css("display","none");			 
		$("#errorchangepasswordstep1server").css("display","none");			 			 
		}	
		else if($("#changedaughtercurrentnewpassword").attr('value') !=$("#changedaughterretypecurrentnewpassword").attr('value'))
		{	
		$("#errorchangepasswordstep1").css("display","block");
		$("#errorchangepasswordcomparate").css("display","block");
		$("#messagecheckfields").css("display","none");
		$("#errorchangepasswordstep1client").css("display","none");
		$("#errorchangepasswordstep1server").css("display","none");			 			 
		}
		else if ($("#changedaughtercurrentnewpassword").attr("value").length <6 || $("#changedaughterretypecurrentnewpassword").attr('value').length <6)
		{
		$("#errorchangepasswordstep1client").css("display","block");
		$("#errorchangepasswordstep1").css("display","block");
		$("#messagecheckfields").css("display","none");	
		$("#errorchangepasswordcomparate").css("display","none");
		$("#errorchangepasswordstep1server").css("display","none");			 			 
		}
	else
		{
		$.showLoader();
		/*CHANGE EMAIL ADDRESS PARENT*/
		UpdateDaughterPasswordFormSwf(idGirlsglobal,$('#changedaughtercurrentpassword').attr('value'),$('#changedaughtercurrentnewpassword').attr('value'));
		}
	}
	else
	{
		successGobal =false;
		loggedexpire(); 
	}

}

function daughterchangepassword()
{
	isValidSesion(daughterchangepasswordlogin);
}


function changestatuschat(success)
	{
 if (success)
	{	
	successGobal=true;
	var statuschatsuperchat;
	var statuschatonoroff;

		if (document.changestatuschat.statuschatone.checked)
		{
			statuschatsuperchat=1;
		}
		else
		{
			statuschatsuperchat=2;
		}
	 
	if (document.changestatuschat.statuschatsecretone.checked)
		statuschatonoroff=true;
	else
		statuschatonoroff=false;

		$.showLoader();
		parentUpdateDaughterChatFormSwf(idGirlsglobal,statuschatsuperchat,statuschatonoroff);
	}
else
{
	loggedexpire();	
}
	}



function parentchangequestionlogin(success)
{
	if (success)
	{	
	successGobal=true;
	var optionSelectSecretQuestion = $("#selectChangeSecretQuestion").selectedValues();  //get value combo of Secret Question
	
	if(optionSelectSecretQuestion ==0)
	{
	$("#errorfieldsquestions").css("display","none");
	$("#errorsecretquestionparent").css("display","block");
	$("#errorminlenquestions").css("display","none");	
	}
	else if(checkField("#quetionsecretanswer"))
	{
	$("#errorfieldsquestions").css("display","block");
	$("#errorsecretquestionparent").css("display","none");
	$("#errorminlenquestions").css("display","none");				
	}
	else if($("#quetionsecretanswer").attr("value").length<4)
	{
	$("#errorfieldsquestions").css("display","none");
	$("#errorsecretquestionparent").css("display","none");
	$("#errorminlenquestions").css("display","block");				
	}
	else
	{
	$.showLoader();
		ChangeChangeQnAFormSwf(optionSelectSecretQuestion,$('#quetionsecretanswer').attr('value'));
	}
	}
	else
	{
	successGobal =false;
	loggedexpire();					
	}	
}

function parentchangequestion()
{
	isValidSesion(parentchangequestionlogin);
}

function loggedexpire()
{
$.modal.impl.close(true);
$("#expirecookiepopup").modal();
$('#expirecookiepopup').css("display","block");	
$('#expirecookiepopup').css("height","350px");
$('#expirecookiepopup').css("width","455px");
$('#expirecookiepopup').css("padding-left","130px");
$("#contenidoSafety").css("display","none");
$("#contenidoAccount").css("display","none");
$("#contenidoGeneralInfo").css("display","none");
$("#contenidoHome").css("display","block");
$("#box_area").css("display","block");
$("#box_area2").css("display","none");
$("#editdaughtercase4").css("display","none");
$("#editdaughtercase1").css("display","none");
$("#editdaughtercase2").css("display","none");
$("#editdaughtercase3").css("display","none");		
$(".myparentaccount").css("background-image", "url(IMG/parents/tab_02_over.gif)");
$(".generalParentInfo").css("background-image", "url(IMG/parents/tab_03_over.gif)");
$(".safetyInfomation").css("background-image", "url(IMG/parents/tab_04_over.gif)");
$(".parentHome").css("background-image", "url(IMG/parents/spacer.gif)");	
$("#title_log_out").css("display","none");

clearBox();

}

function clearBox()
{
document.loginhomepage.youremailhomepage.value="";
document.loginhomepage.yourepasswordhomepage.value="";	
document.login_logged_out.loginloggedoutemail.value="";
document.login_logged_out.loginloggedoutpassword.value="";
}



function processRegisterResponse(dataXml){
	strStatusRegisterSwf=parseXmlSwf("status",dataXml);
	strMessageRegisterSwf=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessFlashRegister(strStatusRegisterSwf,strMessageRegisterSwf);

 } 

function processLoginResponse(dataXml){
	strStatusSwf=parseXmlSwf("status",dataXml);
	$.hideLoader();
	onSuccessFlashLogin(strStatusSwf);
 } 

function processForgotPasswordResponse(dataXml){
	strStatusForgotPasswordSwf=parseXmlSwf("status",dataXml);
	strmessageForgotPassword=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessFlashForgotPassword(strStatusForgotPasswordSwf,strmessageForgotPassword);	
	
}

function processChangeEmailResponse(dataXml){
	strStatusChangeEmailSwf=parseXmlSwf("status",dataXml);
	strmessageChangeEmail=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessFlashChangeEmail(strStatusChangeEmailSwf,strmessageChangeEmail);	
}

function processChangePasswordResponse (dataXml){
	strStatusChangePasswordSwf=parseXmlSwf("status",dataXml);
	strmessageChangePassword=parseXmlSwf("message",dataXml);
	$.hideLoader();	
	onSuccessFlashChangePassword(strStatusChangePasswordSwf,strmessageChangePassword);		
}

function processChangeQnAResponse (dataXml){
	strStatusChangeQnA=parseXmlSwf("status",dataXml);
	strmessageChangeQnA=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessFlashChangeQnA(strStatusChangeQnA,strmessageChangeQnA);		
}
function processUpdateDaughterPasswordResponse (dataXml){
	strStatusUpdateDaughterPassword=parseXmlSwf("status",dataXml);
	strmessageUpdateDaughterPassword=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessUpdateDaughterPassword(strStatusUpdateDaughterPassword,strmessageUpdateDaughterPassword);			
}

function processUpdateDaughterQnAResponse (dataXml){
	strStatusUpdateDaughterQnA=parseXmlSwf("status",dataXml);
	strmessageUpdateDaughterQnA=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessUpdateDaughterQnA(strStatusUpdateDaughterQnA,strmessageUpdateDaughterQnA);	
}

function processAddDaughterResponse(dataXml){
	strStatusAddDaughter=parseXmlSwf("status",dataXml);
	strmessageAddDaughter=parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessAddDaughter(strStatusAddDaughter,strmessageAddDaughter);	
}


function processListDaughtersResponse(dataXml){
	
	var strDaughterId			= parseXmlSwf("id",dataXml);
	var strDaughterScreenName	= parseXmlSwf("screenName",dataXml);
	var strDaughterDetails		= parseXmlSwf("details",dataXml);
	var strDaughterChatStatus	= parseXmlSwf("chatStatus",dataXml);
	var strDaughterAccountStatus= parseXmlSwf("accountStatus",dataXml);
	var struserType= parseXmlSwf("userType",dataXml);

	onSuccessListDaughters(strDaughterId,strDaughterScreenName,strDaughterDetails,strDaughterChatStatus,strDaughterAccountStatus,struserType);	
}


function processDaughterInfoResponse(dataXml)
{
	
		var strDaughterId= parseXmlSwf("id",dataXml);
		var strscreenName= parseXmlSwf("screenName",dataXml);	
		
		var strdetails= parseXmlSwf("details",dataXml);		
		var straccountStatus= parseXmlSwf("accountStatus",dataXml);	
		var strchatStatus= parseXmlSwf("chatStatus",dataXml);			
		var strbadgeUrl= parseXmlSwf("badgeUrl",dataXml);	
		var struserType= parseXmlSwf("userType",dataXml);	
		strchatType= parseXmlSwf("chatType",dataXml);
		strsecretBChat= parseXmlSwf("secretBChat",dataXml);
		
		strDisplaySecretBChat=parseXmlSwf("displaySecretBChat",dataXml);
		$.hideLoader();		
		onSuccessDaughterInfo(strDaughterId,strscreenName,strdetails,straccountStatus,strchatStatus,strbadgeUrl,struserType,strchatType,strsecretBChat,strDisplaySecretBChat);
}



function processUpdateDaughterChatResponse(dataXml){
	var strstatus = parseXmlSwf("status",dataXml);
	var strmessage = parseXmlSwf("message",dataXml);
	$.hideLoader();
	onSuccessUpdateDaughterChat(strstatus,strmessage);
}

function processInfoResponse(dataXml)
{
	
	var emailoldcurrent = parseXmlSwf("email",dataXml);
	$("#emailoldschanges").replaceWith("<span id='emailoldschanges'>"+emailoldcurrent+"</span>");
}

function processLogoutResponse(dataXml)
{
	$.hideLoader();
	strstatus = parseXmlSwf("status",dataXml);
	if(strstatus =="success")
		{
			successGobal=false;
			$("#loggedwindows").css("display","block");
			$("#contenTotal").css("display","none");
			document.loginhomepage.youremailhomepage.value="";
			document.loginhomepage.yourepasswordhomepage.value="";
			document.login_logged_out.loginloggedoutemail.value="";
			document.login_logged_out.loginloggedoutpassword.value="";					
		}
}

function onSuccessUpdateDaughterChat(strstatus,strmessage)
{
	
	if(strstatus =="success")
	{
		$.modal.impl.close(true);
		$("#chatstatuseditsuccespopup").modal();
		$('#chatstatuseditsuccespopup').css("height","350px");
		$('#chatstatuseditsuccespopup').css("width","455px");
		$('#chatstatuseditsuccespopup').css("padding-left","130px");
		deliveryparameters(idGirlsglobal,globalnameGirl,globaluserType);
	}
	$("#errorsecretquestionparent").css("display","block");
	$.hideLoader();	
	
}

function onSuccessDaughterInfo(strDaughterId,strscreenName,strdetails,straccountStatus,strchatStatus,strbadgeUrl,struserType,strchatType,strsecretBChat,strDisplaySecretBChat)
{
	//alert(strDisplaySecretBChat);
if (successGobal)
		{	
		
		var autorenewson="";
		
		if(strdetails!="")
		var accounttype = strdetails[0].split("|");
		
		if(strchatStatus!="")	
		var strstatuscontent= strchatStatus[0].split("|");	
		
		
		
		if(accounttype[1]!=null)
		autorenewson="<span class='manage_cell_details_girls' style='text-align:left'>"+accounttype[1]+"</span>";
		
		if(strchatType==1)
		{
		document.changestatuschat.statuschatone.checked=true;
		}
		else
		{
		document.changestatuschat.statuschattwo.checked=true;
		}
		if(strsecretBChat=="true")
		{
		document.changestatuschat.statuschatsecretone.checked=true;	
		}
		else
		{
		document.changestatuschat.statuschatsecrettwo.checked=true;	
		}
		
		if(strstatuscontent[1]!="")
		{
		if(strstatuscontent[1]=="B CHAT")
		strstatuscontent[1]="<i>B</i> CHAT";
		
		if(strstatuscontent[1]=="SUPER B CHAT")	
		strstatuscontent[1]="SUPER <i>B</i> CHAT";
		
		if(strstatuscontent[1]=="SECRET B CHAT")		
		strstatuscontent[1]="SECRET <i>B</i> CHAT";	
		
		strstatuscontent[1] = strstatuscontent[1]+"&trade;" 
		}
		
		if(strstatuscontent[0]!="")
		{
		if(strstatuscontent[0]=="B CHAT")
		strstatuscontent[0]="<i>B</i> CHAT";
		
		if(strstatuscontent[0]=="SUPER B CHAT")	
		strstatuscontent[0]="SUPER <i>B</i> CHAT";
		
		if(strstatuscontent[0]=="SECRET B CHAT")		
		strstatuscontent[0]="SECRET <i>B</i> CHAT";							
		
		strstatuscontent[0] = strstatuscontent[0]+"&trade;" 				
		}
		
		if (straccountStatus=="ACTIVE")
		{
			if("BASIC"==struserType)
			{
			document.changestatuschat.statuschatsecretone.checked=false;	
			document.changestatuschat.statuschatsecrettwo.checked=true;	
			$("#superBchatOptions").css("display","none");
			$("#typeacount").replaceWith("<span class='txt_yellow'  id='typeacount' style='text-align:left'><p>"+accounttype[0]+"</span>");
			//$("#accountstatus").replaceWith("<b class='txt_yellow'>"+struserType+"</b>");				
			$("#statuschat").replaceWith("<span class='txt_yellow' id='statuschat' style='text-align:left'>"+strstatuscontent[0]+"<br/>"+strstatuscontent[1]+"</span>");
			$("#mpnamegirlscase1").replaceWith("<span class='ttl_box2'  id='mpnamegirlscase1'  style='text-align:left'>"+strscreenName+"</span>");
			$("#editdaughtercase1").css("display","block");
			$("#editdaughtercase2").css("display","none");
			$("#editdaughtercase3").css("display","none");
			$("#editdaughtercase4").css("display","none");
			$("#editdaughtercaseBanned").css("display","none");
			$("#contenidoAccount").css("display","none");		
			$("#editdaughtercaseclosed").css("display","none");
			$("#parent_manage_close").css("display","none");
			}
		//struserType=	"SUBSCRIPTION";
			if("DEVICE_OWNER" ==struserType || "SUBSCRIPTION" ==struserType)
			{
			
			$("#expiresmp3").replaceWith("<span id='expiresmp3'>"+autorenewson+"</span>");
			$("#acountstatusmp3").replaceWith("<span class='txt_yellow' id='acountstatusmp3'  style='text-align:left'>"+accounttype[0]+"</span>");
			$("#chatstatusmp3").replaceWith("<span class='txt_yellow' id='chatstatusmp3' style='text-align:left'>"+strstatuscontent[0]+"<br/>"+strstatuscontent[1]+"</span>");
			$("#mpnamegirlsmp3").replaceWith("<span class='ttl_box2'  id='mpnamegirlsmp3'  style='text-align:left'>"+strscreenName+"</span>");
			$("#editdaughtercase2").css("display","block");
			$("#contenidoAccount").css("display","none");	
			$("#editdaughtercase1").css("display","none");
			$("#editdaughtercase3").css("display","none");
			$("#editdaughtercase4").css("display","none");
			$("#editdaughtercaseBanned").css("display","none");
			$("#editdaughtercaseclosed").css("display","none");	
			$("#parent_manage_close").css("display","none");
			
			if(strDisplaySecretBChat=="true")
			{
				$("#superBchatOptions").css("display","block");			
			}
			else
			{
				$("#superBchatOptions").css("display","none");					
			}
			}
			
				if("SUBSCRIPTION" ==struserType)
					{
					$("#parent_renew_now").css("display","none");
					$("#parent_manage").css("display","block");
					$("#get_more_vip").css("display","block");	
					}			
				else
				{
					$("#get_more_vip").css("display","none");	
					$("#parent_renew_now").css("display","block");
					$("#parent_manage").css("display","none");
				}
				
			
		}
		else
		{
			if("INACTIVE"==straccountStatus )
			{
				$("#inactivetitlestatus").replaceWith("<span class='txt_yellow' id='inactivetitlestatus' style='text-align:left'><span><b>"+accounttype[0]+"</b></p></span>");
				$("#dateexpired").replaceWith("<span id='dateexpired'>"+autorenewson+"</span>");
				$("#chatstatusinactive").replaceWith("<span class='lnk_options_gray_stg'  style='text-align:left' id='chatstatusinactive'>"+strstatuscontent[0]+"<br/>"+strstatuscontent[1]+"</span><br/>");
				$("#inactiveaccount").replaceWith("<span class='ttl_box2' id='inactiveaccount'  style='text-align:left'>"+strscreenName+"</span>");
				$("#editdaughtercase4").css("display","block");
				$("#editdaughtercase1").css("display","none");
				$("#editdaughtercase2").css("display","none");
				$("#editdaughtercase3").css("display","none");
				$("#editdaughtercaseclosed").css("display","none");		
				$("#editdaughtercaseBanned").css("display","none");
				$("#contenidoAccount").css("display","none");
				$("#superBchatOptions").css("display","block");	
				$("#parent_manage_close").css("display","none");
				$("#renew_now_inactive").css("display","block");		
				
			}
			if("BANNED"==straccountStatus ||  "OPTED_OUT"==straccountStatus)
			{
				$("#idTextBanned").replaceWith("<span class='txt_yellow'  style='text-align:left' id='idTextBanned'>"+accounttype[0]+"<br/></span>");
				$("#mpnamegirlscasebanned").replaceWith("<span class='ttl_box2' id='mpnamegirlscasebanned'  style='text-align:left'>"+strscreenName+"</span>");
				$("#editdaughtercase4").css("display","none");
				$("#editdaughtercase1").css("display","none");
				$("#editdaughtercase2").css("display","none");
				$("#editdaughtercase3").css("display","none");
				$("#editdaughtercaseclosed").css("display","none");
				$("#editdaughtercaseBanned").css("display","block");
				$("#contenidoAccount").css("display","none");
				$("#superBchatOptions").css("display","block");	
				$("#parent_manage_close").css("display","none");
			}	
			
			if("CANCELLED"==straccountStatus )
			{
				$("#idTextClosed").replaceWith("<span class='txt_yellow'  style='text-align:left' id='idTextClosed'>"+accounttype[0]+"<br/></span>");
				$("#mpnamegirlscaseclose").replaceWith("<span class='ttl_box2' id='mpnamegirlscaseclose'  style='text-align:left'>"+strscreenName+"</span>");
				$("#editdaughtercase4").css("display","none");
				$("#editdaughtercase1").css("display","none");
				$("#editdaughtercase2").css("display","none");
				$("#editdaughtercase3").css("display","none");
				$("#editdaughtercaseBanned").css("display","none");
				$("#editdaughtercaseclosed").css("display","block");
				$("#contenidoAccount").css("display","none");
				$("#superBchatOptions").css("display","block");	
				$("#parent_manage_close").css("display","none")		
				
				if("SUBSCRIPTION" ==struserType)
					{
						$("#parent_manage_close").css("display","block")
					}
				
			}		
		}
		}
		else
		{
		loggedexpire();
		}	

	
}


function onSuccessListDaughters(strDaughterId,strDaughterScreenName,strDaughterDetails,strDaughterChatStatus,strDaughterAccountStatus,struserType)
{
	
	var constructTable = "";
	var stringFuntion;
	var strDaughterChatStatusSplit;	
	for(i=0;i<strDaughterId.length;i++)
	{
	accountDetailsSplit = strDaughterDetails[i].split("|");
	strDaughterChatStatusSplit=	strDaughterChatStatus[i].split("|");
	
	
	if(strDaughterChatStatusSplit[0]!="")
	{
	if(strDaughterChatStatusSplit[0]=="B CHAT")
	strDaughterChatStatusSplit[0]="<i>B</i> CHAT";
	
	if(strDaughterChatStatusSplit[0]=="SUPER B CHAT")	
	strDaughterChatStatusSplit[0]="SUPER <i>B</i> CHAT";
	
	if(strDaughterChatStatusSplit[0]=="SECRET B CHAT")		
	strDaughterChatStatusSplit[0]="SECRET <i>B</i> CHAT";
	
	strDaughterChatStatusSplit[0]=strDaughterChatStatusSplit[0]+"&trade;"
	
	}
	if(strDaughterChatStatusSplit[1]!="")
	{
	if(strDaughterChatStatusSplit[1]=="B CHAT")
	strDaughterChatStatusSplit[1]="<i>B</i> CHAT";
	
	if(strDaughterChatStatusSplit[1]=="SUPER B CHAT")	
	strDaughterChatStatusSplit[1]="SUPER <i>B</i> CHAT";
	
	if(strDaughterChatStatusSplit[1]=="SECRET B CHAT")		
	strDaughterChatStatusSplit[1]="SECRET <i>B</i> CHAT";					
	
	strDaughterChatStatusSplit[1]=strDaughterChatStatusSplit[1]+"&trade;"
	}
	
	if(accountDetailsSplit[0]=="BANNED")
	accountDetailsSplit[1]="";
	
	if(accountDetailsSplit[0]=="OPTED OUT")
	accountDetailsSplit[1]="";
	
	if(accountDetailsSplit[0]=="CLOSED")
	accountDetailsSplit[1]="";
	
	if(accountDetailsSplit[1]=="null")
	accountDetailsSplit[1]="";
	
	constructTable = constructTable.concat("<div class='manage_cell_user'>");
	
	constructTable = constructTable.concat("<div class='daughter_tab_cell_1'>");
	
	stringFuntion = "onclick='deliveryparameters(\"" + strDaughterId[i];
	stringFuntion = stringFuntion + "\",\"";
	stringFuntion = stringFuntion + strDaughterScreenName[i] + "\"";
	stringFuntion = stringFuntion + ",\"";
	stringFuntion = stringFuntion + struserType[i] + "\")'";
	
	constructTable = constructTable.concat("	<div id='editdatadaughter_"+i+"' class='lnk_user_specialList' " + stringFuntion + "><span>"+strDaughterScreenName[i]+"</span></div>");
	constructTable = constructTable.concat("	<div class='daughter_tab_cell_1'>");
	/*			constructTable = constructTable.concat("		<div class='manage_icon'><img src='IMG/parents/icon_02.gif' alt='' width='31' height='27' /></div>");*/
	/*			constructTable = constructTable.concat("		<div class='manage_icontxt'>"+strDaughterAccountStatus[i]+"</div>");*/
	constructTable = constructTable.concat("	</div>");
	constructTable = constructTable.concat("</div>");
	
	constructTable = constructTable.concat("<div class='manage_cell_details1'><b><p>"+accountDetailsSplit[0]+"</p><p>"+accountDetailsSplit[1]+"</p></b></div>");
	constructTable = constructTable.concat("<div class='manage_cell_details2' style='text-align:left'><b>"+strDaughterChatStatusSplit[0]+"<br/>"+strDaughterChatStatusSplit[1]+"</b></div>");
	
	constructTable = constructTable.concat("</div>");
	
	constructTable = constructTable.concat("<div class='manage_cell3'></div>");
	$("#little_box").css("padding-top",i + "px");
	$("#little_box").css("padding-left", "0px");
	$("#little_box").css("padding-right", "0px");
	}
	$("#datacopydaughter").html(constructTable);
	$("#listgirls").css("display","block");
	$.hideLoader();
	

}

function onSuccessAddDaughter(strStatusAddDaughter,strmessageAddDaughter)
{
	if(strStatusAddDaughter =="success")
		{
			$.modal.impl.close(true);
			
			fillDaughter('2');
		
			$('#adddaughterpopup').modal();
			$('#inputinfoadddaughter').css("display","none");
			$('#confirmationdaughter').css("display","block");
			$('#adddaughterpopup').css("padding-left","55px");
			$.hideLoader();
			
			var toppx = (toppx+100);
			var toppx1= (toppx1+0.1);
			
			$('#float_fix1').css("padding-top",toppx+"px");
			$('#little_box').css("padding-top",toppx1+"px");
		}
		else{
			$.hideLoader();
			$("#erroraddaccount").css("display","none");
			$("#erroraddaccountserver").replaceWith("<div class='cont_err_pp' id='erroraddaccountserver'><span class='txt_ttl_err_pp'>"+strmessageAddDaughter+"</span></div>");
		}
}

function onSuccessUpdateDaughterQnA(strStatusUpdateDaughterQnA,strmessageUpdateDaughterQnA)
{
	if(strStatusUpdateDaughterQnA =="success")
	{
		$.hideLoader();
		$.modal.impl.close(true);
		$("#changesuccesssecretquestion").modal();
		$('#changesuccesssecretquestion').css("height","350px");
		$('#changesuccesssecretquestion').css("width","455px");
		$('#changesuccesssecretquestion').css("padding-left","130px");
	}
	else{
		$.hideLoader();
		$("#errodupdatequetiondaughterminleng").css("display","none");
		$("#errodupdatequetiondaughter").css("display","none");
		$("#errodupdatequetiondaughtersecretanswer").css("display","none");
		$("#errodupdatequetiondaughterserver").replaceWith("<div id='cont_err_ly'><span class='txt_ttl_err_ly'>"+strmessageUpdateDaughterQnA+"</span></div>");
	}
	
}

function onSuccessUpdateDaughterPassword(strStatusUpdateDaughterPassword,strmessageUpdateDaughterPassword)
{
	if(strStatusUpdateDaughterPassword =="success")
	{
		$.hideLoader();	
		$.modal.impl.close(true);
		$("#changesecretquestionpopupupdatesteppopup").modal();
		$('#changesecretquestionpopupupdatesteppopup').css("height","350px");
		$('#changesecretquestionpopupupdatesteppopup').css("width","455px");
		$('#changesecretquestionpopupupdatesteppopup').css("padding-left","130px");
	}
	else
	{
		$.hideLoader();
		$("#errorchangepasswordstep1client").css("display","none");
		$("#errorchangepasswordstep1").css("display","block");
		$("#errorchangepasswordcomparate").css("display","none");			
		$("#messagecheckfields").css("display","none");
		$("#errorchangepasswordstep1server").css("display","block");
		$("#errorchangepasswordstep1server").replaceWith("<span class='txt_ttl_err_ly' id='errorchangepasswordstep1server'>"+strmessageUpdateDaughterPassword+"</span>");							
		$("#errorchangepasswordstep1server").css("display","block");
	}
}

function onSuccessFlashChangeQnA(strStatusChangeQnA,strmessageChangeQnA)
{
	if(strStatusChangeQnA =="success")
	{
		$.hideLoader();	
		$("#errorfieldsquestions").css("display","none");
		$("#errorsecretquestionparent").css("display","none");
		$("#errorminlenquestions").css("display","none");	
		$.modal.impl.close(true);
		$("#changesuccesssecretquestion").modal();
		$('#changesuccesssecretquestion').css("height","350px");
		$('#changesuccesssecretquestion').css("width","455px");
		$('#changesuccesssecretquestion').css("padding-left","130px");
	}
	else
	{
		$.hideLoader();
		$("#errorminlenquestions").css("display","none");	
		$("#errorfieldsquestions").css("display","none");
		$("#errorsecretquestionparent").css("display","none");
		$("#errorsecretquestionparent").replaceWith("<div id='cont_err_ly'><span class='txt_ttl_err_ly'>"+strmessageChangeQnA+"</span></div>");
	}

}

function onSuccessFlashChangePassword(strStatusChangePasswordSwf,strmessageChangePassword)
{
	if(strStatusChangePasswordSwf =="success")
	{
		$.hideLoader();	
		$("#erroremailparente").css("display","none");
		$.modal.impl.close(true);
		$("#successchangepassword").modal();
		$('#successchangepassword').css("height","350px");
		$('#successchangepassword').css("width","455px");
		$('#successchangepassword').css("padding-left","130px");
	}
	else
	{
		$.hideLoader();
		$("#changepaswordparentsfor").css("display","none");
		$("#changepaswordparentsThree").css("display","none");						
		$("#errorpasswordparentchange").css("display","block");
		$("#changepaswordparentsone").css("display","none");
		$("#changepaswordparentstwo").replaceWith("<div ><span class='txt_ttl_err_ly' id='changepaswordparentstwo'>"+strmessageChangePassword+"</span></div>");
	}
	
}

function onSuccessFlashLogin(strStatusSwf)
	{
	if(strStatusSwf =="success")
		{
			MATTEL.tracker.Tracker.track({brand:"barbiegirls",channel:"Parents Place",contenttype:"Activity",name:"Account Details",action:"View", subchannel:"Account Details" });
			successGobal=true;
			$("#loggedwindows").css("display","none");		
			$("#menu_text_active").css("display","block");	
			$("#menu_text_inactive").css("display","none");	
			$("#img").css("background-image","url(IMG/parents/img_parent.gif)");
			$("#img").css("background-repeat","no-repeat");
				
			//firlnamegirls();
			$("#contenTotal").css("display","block");
			$(".myparentaccount").css("background-image", "url(IMG/parents/spacer.gif)");
			$("#contenidoSafety").css("display","none");
			$("#contenidoAccount").css("display","block");
			$("#contenidoGeneralInfo").css("display","none");
			$("#contenidoHome").css("display","none");
			$(".parentHome").css("background-image", "url(IMG/parents/tab_01.gif)");
			$(".generalParentInfo").css("background-image", "url(IMG/parents/tab_03.gif)");
			$(".safetyInfomation").css("background-image", "url(IMG/parents/tab_04.gif)");
			$("#editdaughtercase3").css("display","none");
			$("#editdaughtercase2").css("display","none");				
			$("#editdaughtercase1").css("display","none");					
			$("#editdaughtercase4").css("display","none");	
			$("#tit_area1_login").css("display","block");
			$("#box_home_login").css("display","block");	
			$("#box_home").css("display","none");	
			$("#tit_area1").css("display","none");						
			$("#title_log_out").css("display","block");
			fillDaughter('2')
			tabParenthome=true;
			tabParentAccountDetails=false;
			tabParentMessageParents=true;
			tabParentOnlineSafety=true;	
			clearBox();	
								
	}
	else
	{
		successGobal=false;
		//$.hideLoader();
		$("#loginerrorpopup").modal();
		$('#loginerrorpopup').css("height","350px");
		$('#loginerrorpopup').css("width","455px");
		$('#loginerrorpopup').css("padding-left","130px");
	}
		
	}

function loginFormSwf(strEmail,strPassword)
{
	strStatusSwf="";
	strTimeoutSwf="";
	$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
	$('#swfGateway').flash(
	{ 
		src: 'SWF/parental/parentalLogin.swf',
		width: 1,
		height: 1,
		flashvars: {sURL:environment+"/pi/parentLogin.do", sEmail: strEmail, sPassword: strPassword }
	},
		{ version: 8 }
	);
}

 function registerParentFormSwf(strEmail,strPassword,strQuestionId,strAnswer,strdScreenName,strdPassword,strreceiveNews,stragreement)
{
	strStatusSwf="";
	strTimeoutSwf="";
	$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
	$('#swfGateway').flash(
	{ 
		src: 'SWF/parental/parentalRegister.swf',
		width: 1,
		height: 1,
		flashvars: {sURL:environment+"/pi/parentRegistration.do", email: strEmail, password: strPassword,questionId:strQuestionId,answer:strAnswer,dScreenName:strdScreenName,dPassword:strdPassword,receiveNews:strreceiveNews,agreement:stragreement}
	},
		{ version: 8 }
	);
}

 function forgotPasswordParentFormSwf(strEmail, strAnswer)
{
	strStatusSwf="";
	strTimeoutSwf="";
	$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
	$('#swfGateway').flash(
	{ 
		src: 'SWF/parental/parentalForgotPassword.swf',
		width: 1,
		height: 1,
		flashvars: {sURL:environment+"/pi/parentForgotPassword.do", email: strEmail, answer: strAnswer}
	},
		{ version: 8 }
	);
}


 function changeEmailParentFormSwf(strEmail)
{
	$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
	$('#swfGateway').flash(
	{ 
		src: 'SWF/parental/parentalChangeEmail.swf',
		width: 1,
		height: 1,
		flashvars: {sURL:environment+"/pi/parentChangeEmail.do", newEmail: strEmail}
	},
		{ version: 8 }
	);
}

 function ChangePasswordParentFormSwf(stroldPassword,strnewPassword)
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentalChangePassword.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentChangePassword.do", oldPassword: stroldPassword,newPassword:strnewPassword}
		},
			{ version: 8 }
		);
	}
	
	 function ChangeChangeQnAFormSwf(strquestionId,stranswer)
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentalChangeQnA.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentChangeQnA.do", questionId: strquestionId,answer:stranswer}
		},
			{ version: 8 }
		);
	}
	
	 function UpdateDaughterPasswordFormSwf(strdId,stroldPassword,strnewPassword)
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentalUpdateDaughterPassword.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentUpdateDaughterPassword.do", dId: strdId,oldPassword:stroldPassword,newPassword:strnewPassword}
		},
			{ version: 8 }
		);
	}
	
	 function UpdateDaughterQnAFormSwf(strdId,strquestionId,stranswer)
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentalUpdateDaughterQnA.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentUpdateDaughterQnA.do", dId:strdId,questionId:strquestionId,answer:stranswer}
		},
			{ version: 8 }
		);
	}


	 function addDaughterFormSwf(strdScreenName,strdPassword)
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentalAddDaughter.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentAddDaughter.do", dScreenName:strdScreenName,dPassword:strdPassword}
		},
			{ version: 8 }
		);
		
	}
	
	
	function parentListDaughtersFormSwf()
	{
			
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentListDaughters.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentListDaughters.do"}
		},
			{ version: 8 }
		);
		
	}
	
	
	
	
	function parentDaughterInfoFormSwf(strdId)
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentDaughterInfo.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentDaughterInfo.do",dId:strdId}
		},
			{ version: 8 }
		);
		
	}
	
	
	function parentUpdateDaughterChatFormSwf(strdId,strchatType,strsecretBChat)
	{
		
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentUpdateDaughterChat.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentUpdateDaughterChat.do",dId:strdId,chatType:strchatType,secretBChat:strsecretBChat}
		},
			{ version: 8 }
		);
		
	}	
	
	
	function parentprocessInfoResponseFormSwf()
	{
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentInfo.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentInfo.do"}
		},
			{ version: 8 }
		);
		
	}	
		
	function parentprocessLogoutResponseFormSwf()
	{
		$("#listgirls").css("display","none");
		
		$('#swfGateway').replaceWith("<div  id='swfGateway'></div>")
		$('#swfGateway').flash(
		{ 
			src: 'SWF/parental/parentLogout.swf',
			width: 1,
			height: 1,
			flashvars: {sURL:environment+"/pi/parentLogout.do"}
		},
			{ version: 8 }
		);
		
	}			
		
		
	

function onSuccessFlashRegister(strStatusRegisterSwf,strMessageRegisterSwf)
{
		$.hideLoader();
		$("#errorregistrationemail").css("display","none");
		$("#errorregistrationpasswordminortoseven").css("display","none");
		$("#errorregistrationpasswordmatch").css("display","none");
		$("#errorregistrationquetion").css("display","none");
		$("#errorregistrationinformation").css("display","none");
		$("#errorregistrationinformationtermsconditions").css("display","none");

		if(strStatusRegisterSwf=="success")
		{
			$.modal.impl.close(true);
			$("#registationsucces").modal();
			$.showLoader();	
			MATTEL.tracker.Tracker.track({brand:"barbiegirls",channel:"Parents Place",contenttype:"Form",name:"Account Registration Complete",action:"Complete",scenarioname:"Parent Account Registration",scenariostep:"2",scenariostatus:"1"});

			loginFormSwf(stremailregister,strpasswordregister);
		}
		else
		{
			$("#errorregistrationquetionminLen").css("display","none");
			$("#errorregistrationemail").css("display","none");
			$("#errorregistrationpasswordminortoseven").css("display","none");
			$("#errorregistrationpasswordmatch").css("display","none");
			$("#errorregistrationquetion").css("display","none");
			$("#errorregistrationinformation").css("display","none");
			$("#errorregistrationfields").css("display","block");			
			$("#errorregistrationpasswordRequired").css("display","none");		
			$("#errorregistrationemailRequired").css("display","none");		
			$("#errorregistrationquetionRequired").css("display","none");
			$("#errorregistrationfields").css("display","none");	
			$("#errorregistrationpasswordRequired").css("display","none");
		/*TERM AND CONDITIONS*/
			$("#errorregistrationinformationtermsconditions").replaceWith("<div class='cont_err_pp' id='errorregistrationinformationtermsconditions'><span class='txt_ttl_err_pp'>"+strMessageRegisterSwf+"</span></div>");
			$("#errorregistrationinformationtermsconditions").css("display","block");
		}

}



function loginFromHomePage()
{
	if (checkField("#youremailhomepage") || checkField("#yourepasswordhomepage"))
	{
	$("#loginerrorpopup").modal();
	$('#loginerrorpopup').css("height","350px");
	$('#loginerrorpopup').css("width","455px");
	$('#loginerrorpopup').css("padding-left","130px");
	
	}
	else if(checkMailFormat("#youremailhomepage"))
	{
	$("#loginerrorpopup").modal();
	$('#loginerrorpopup').css("height","350px");
	$('#loginerrorpopup').css("width","455px");
	$('#loginerrorpopup').css("padding-left","130px");
	}
	else
	{
		$.showLoader();	
		loginFormSwf($('#youremailhomepage').attr('value'),$('#yourepasswordhomepage').attr('value'));
	}
}

function loginFromLoggedOut()
{
	if (checkField("#loginloggedoutemail") || checkField("#loginloggedoutpassword"))
	{
	$("#loginerrorpopup").modal();
	$('#loginerrorpopup').css("height","350px");
	$('#loginerrorpopup').css("width","455px");
	$('#loginerrorpopup').css("padding-left","130px");
	}
	else if(checkMailFormat("#loginloggedoutemail"))
	{
	$("#loginerrorpopup").modal();
	$('#loginerrorpopup').css("height","350px");
	$('#loginerrorpopup').css("width","455px");
	$('#loginerrorpopup').css("padding-left","130px");
	}
	else
	{
	$.showLoader();		
	loginFormSwf($('#loginloggedoutemail').attr('value'),$('#loginloggedoutpassword').attr('value'));
	}
}

function onSuccessFlashForgotPassword(strStatusForgotPasswordSwf,strmessageForgotPassword)
	{
		if(strStatusForgotPasswordSwf=="success")
		{
			$.modal.impl.close(true);
			$("#forgotpasswordpopup").modal();
			$('#contentStep1').css("display","none");
			$('#contentStep2').css("display","none");
			$('#contentStep3').css("display","block");
			$('#forgotpasswordpopup').css("height","350px");
			$('#forgotpasswordpopup').css("width","455px");
			$('#forgotpasswordpopup').css("padding-left","130px");
		}
		else
		{
			$.hideLoader();
			$("#errorforgotpasswordstep2").css("display","block");
			$("#errorforgotpasswordstepmessage").replaceWith("<span  class='txt_yellow' id='errorforgotpasswordstepmessage'>"+strmessageForgotPassword+"</span>");
		}

	}
	
function onSuccessFlashChangeEmail(strStatusChangeEmailSwf,strmessageChangeEmail)
{
	if(strStatusChangeEmailSwf =="success")
	{
		$.hideLoader();
		$("#erroremailparente").css("display","none");
		$.modal.impl.close(true);
		$("#changeemailPopup").modal();
		$('#changeemailPopup').css("height","350px");
		$('#changeemailPopup').css("width","455px");
		$('#changeemailPopup').css("padding-left","130px");
		$("#changeEmailStep1").css("display","none");
		$("#changeEmailStep2").css("display","block");
	}
	else
	{
		$.hideLoader();
		$("#textmessageclienttwo").css("display","none");
		$("#textmessageclientone").css("display","none");
		$("#contenterrors").css("display","block");
		$("#textmessageclient").css("display","none");
		$("#textmessageserver").css("display","block");
		$("#textmessageserver").replaceWith("<span class='txt_ttl_err_ly' id='textmessageserver'>"+strmessageChangeEmail+"</span>");
	}
}

function sendForgotPassword()
{
if (checkMailFormat("#txtemailaddressforgotpassword"))
{
	$("#errorforgotpassword").css("display","block");
}
else
{	$.showLoader();
emailforgot	=$('#txtemailaddressforgotpassword').attr('value');


webService("pi/parentForgotPassword.do","email="+$('#txtemailaddressforgotpassword').attr('value'));
strstatus = parseXml("status");
strmessage = parseXml("message");
strquestion = parseXml("questionText");

if(strstatus[0] =="success")
{
$.hideLoader();
$.modal.impl.close(true);
$("#forgotpasswordpopup").modal();
$('#contentStep1').css("display","none");
$('#contentStep2').css("display","block");
$('#forgotpasswordpopup').css("height","350px");
$('#forgotpasswordpopup').css("width","455px");
$('#forgotpasswordpopup').css("padding-left","130px");
$("#showquestionsecret").css("display","block");
$("#showquestionsecret").replaceWith("<div id='showquestionsecret' class='txt_yellow'>"+strquestion+"</div>");
}
else
{
$.hideLoader();
$("#errorforgotpassword").css("display","block");
$("#errorforgotpassword").replaceWith("<div id='cont_err_ly' ><span class='txt_ttl_err_ly'>"+strmessage[0]+"</span></div>");
}
}
}


function forgotPasswordAswer()
{
	if (checkField("#txtyouranswerforgotpassword"))
	{
		$("#errorforgotpasswordstep2").css("display","block");
	}
	else
	{
	$.showLoader();
	forgotPasswordParentFormSwf(emailforgot,$('#txtyouranswerforgotpassword').attr('value'))
	}
}


/*function firlnamegirls()
{


webService("pi/parentListDaughters.do","");
var stridgirls = parseXml("id");
var strscreenNamegirls = parseXml("screenName");

var flalistgirls;
		

}*/

function getNameGirls(obj)
{
var girlsnamesubscription;
girlsnamesubscription=obj.options[obj.selectedIndex].text;
$("#screenname").val(girlsnamesubscription)
}

//FUNCTION VALIDATIONS ENDS
//jsaavedra 03/16/2008

function fillDaughterlogin(success)
{
	$.showLoader();	
	if (success)
	{	
		parentListDaughtersFormSwf();
	}
	else
	{
		loggedexpire();
	}
}


var fillDaughter = function(strreference)
{
	if(strreference!='3')
		isValidSesion(strreference);	
	else
		fillDaughterlogin(true);
};	


function dsttrack(id)
{
	var tag = ["barbi730","login957","login087","regis030","regis760","regis160","subsc941","subsc771","subsc760","subsc951","","","regis756","regis183","regis918","commu631","commu717"];

	var axel = Math.random()+"";
	var a = axel * 10000000000000;
	
	var img1 = '<IMG SRC="https://ad.doubleclick.net/activity;src=1839984;type=matte772;cat='+ tag[id - 1] +';ord=1;num='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0>';
	var img2 = '<IMG SRC="https://ad.doubleclick.net/activity;src=1839984;type=matte772;cat='+ tag[id - 1] +';ord=1;num=1?" WIDTH=1 HEIGHT=1 BORDER=0>';
	
	$("#dsttrack1").hide().html(img1);
	//$("#dsttrack2").hide().html(img2);
}

function dsttrack1()
{
	
	var axel = Math.random()+"";
	var a = axel * 10000000000000;
	
	var img1 = '<IMG SRC="https://ad.doubleclick.net/activity;src=1799702;type=barbi101;cat=barbi210;ord='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0>';
	var img2 = '<IMG SRC="http://ad.doubleclick.net/activity;src=1799702;type=barbi101;cat=barbi210;ord=1?" WIDTH=1 HEIGHT=1 BORDER=0>';
	
	$("#dsttrack1").hide().html(img1);

}

function dsttrack2()
{
	
	var axel = Math.random()+"";
	var a = axel * 10000000000000;
	
	var img1 = '<IMG SRC="http://ad.doubleclick.net/activity;src=1268629;type=barbi986;cat=barbi752;ord='+ a + '?" WIDTH=1 HEIGHT=1 BORDER=0>';
	var img2 = '<IMG SRC="http://ad.doubleclick.net/activity;src=1268629;type=barbi986;cat=barbi752;ord=1?" WIDTH=1 HEIGHT=1 BORDER=0>';
	
	$("#dsttrack1").hide().html(img1);

}

function logOutPage()
	{
		$.showLoader();	
		parentprocessLogoutResponseFormSwf();
	}

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}


function returnaccountbasic()
{		
	$("#editdaughtercase1").css("display","none");
	$("#contenidoAccount").css("display","block");
	fillDaughter('2')
}


function returnaccountvipSubscription()
{														 
	$("#editdaughtercase2").css("display","none");
	$("#contenidoAccount").css("display","block");
	fillDaughter('2')
}


function returnaccountBanned(success)
{											
	$("#editdaughtercaseBanned").css("display","none");
	$("#contenidoAccount").css("display","block");
	fillDaughter('2')
}


function returnaccountclosed()
{														 
	$("#editdaughtercaseclosed").css("display","none");
	$("#contenidoAccount").css("display","block");
	fillDaughter('2')
}


function returnaccount3()
{												
	$("#editdaughtercase3").css("display","none");
	$("#contenidoAccount").css("display","block");
	fillDaughter('2')
}


function returnaccount4()
{													
	$("#editdaughtercase4").css("display","none");
	$("#contenidoAccount").css("display","block");
	fillDaughter('2')
}

var environment=getSecureDomain();
