
function setCookie(name, value, expire) {   document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))}

function getCookie(Name) {   
	var search = Name + "=";   
	if (document.cookie.length > 0){ 
		// if there are any cookies      
		offset = document.cookie.indexOf(search);
		if (offset != -1) { 
		// if cookie exists
		    offset += search.length ;        
			// set index of beginning of value         
			end = document.cookie.indexOf(";", offset)  ;        
			// set index of end of cookie value         
			if (end == -1)             
				end = document.cookie.length;         
			return unescape(document.cookie.substring(offset, end));      
		}    
	}
}

function getCookieParm(Name,Parm){
	var cookieStr = getCookie(Name);
	if (cookieStr==null || cookieStr.length == 0){return "";}
	
	var searchStr = Parm +"=";
	offset = cookieStr.indexOf(searchStr);
	if (offset != -1) { 
	    offset += searchStr.length ;        
		// set index of beginning of value         
		end = cookieStr.indexOf("&", offset);        
		// set index of end of cookie value         
		if (end == -1)             
			end = cookieStr.length;         
		return unescape(cookieStr.substring(offset, end));      
	}    
}
function callURL(URL,c){
	window.open(URL+"?id="+c+"&parm2="+parm1,"win","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+window.width+",height="+window.height);
}
function callURL(URL,c,p1){
	if (p1==null){p1="";}
	window.open(URL+"?id="+c+"&parm1="+p1+"&parm2="+parm1,"win","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+window.width+",height="+window.height);
}

var code = "24X7"; 
var linkID = getCookieParm("4ALLDRVAffiliateLinkSignature","linkID");
var parm1 =  getCookieParm("4ALLDRVAffiliateLinkSignature","parm1");
if (parm1==null){parm1="";}
if (linkID.length > 0){code = linkID+"-"+code;}
