var host="http://www.poppydog.com";
//var host="http://localhost:9090";
//var host='http://192.168.0.2: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.location.href.indexOf("sitebuilder.yola")>-1)return true;
doPassLand(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="+addParamsToUrl(pd_myLoginReturnPath,"pd_passland=t");	
		    }
		    else{
			returnPath="&returnPath="+escape(addParamsToUrl(getHref(),"pd_passland=t"));
		    }
	

		    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+"/comreg/login.do?action=w_lo1&tiid="+in_hostID+"_reg&l=1"+returnPath+extraParams);
			else	    
	     		location.replace(host+"/comreg/login.do?action=w_lo1&tiid="+in_hostID+"_reg&l=1"+returnPath+extraParams);
	     	return false;
          }
    } 
    return true;

}


function pd_ronfull_init (in_hostID) {
if (document.location.href.indexOf("sitebuilder.yola")>-1)return true;
	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");
		}
	
	}    
}



