var host="http://www.poppydog.com";
//var host="http://localhost:9090";
var isOfficeLive = false;

try{
			var iframes = top.document.getElementsByTagName("iframe");
			for (var i=0; i< iframes.length; i++){
				if (iframes.item(i).id.indexOf("CPH_Content_HtmlControl")>-1){
					isOfficeLive = true;
				}
			}
			}
			catch(e){isOfficeLive=false;}



function pd_ron_init (in_hostID) {


    if (document.cookie.indexOf("poppydogl_"+in_hostID)<0){
            if (location.search.indexOf("gbzwdp")>-1){ 
                document.cookie="poppydogl_"+in_hostID+"=t; path=/";
            }
            else{ 
		var returnPath="";
		    if (self.pd_myLoginReturnPath){
		        returnPath="&returnPath="+pd_myLoginReturnPath;	
		    }
		    else{
			returnPath="&returnPath="+escape(location.href);
		    }
	

		    var extraParams="";
		    if (self.pd_myLoginParameters){
		        if (pd_myLoginParameters.substring(0,1)=="&" || pd_myLoginParameters.substring(0,1)=="?")
	    		    extraParams="&"+pd_myLoginParameters.substring(1,pd_myLoginParameters.length);
		        else
	        		extraParams="&"+pd_myLoginParameters;	
		    }
		    
		    if (isOfficeLive)
				top.location.replace(host+"/membersArea.do?tiid="+in_hostID+"&l=1"+returnPath+extraParams);
			else	    
	     		location.replace(host+"/membersArea.do?tiid="+in_hostID+"&l=1"+returnPath+extraParams);
	     	return false;
          }
    } 
    return true;

}


function pd_ronfull_init (in_hostID) {

	if (pd_ron_init(in_hostID)){
		if (document.cookie.indexOf(in_hostID+"_FULL")<0){
			if (isOfficeLive)
				top.location.replace(host+"/reg/payment/member.do?hid="+in_hostID+"&action=upgrade&accessRequest=t");
			else
				location.replace(host+"/reg/payment/member.do?hid="+in_hostID+"&action=upgrade&accessRequest=t");
		}
	
	}    
}



