function Is() {
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 2));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4b = (this.ns && (this.minor < 4.04));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie   = (agent.indexOf("msie") != -1);
	this.ie3  = (this.ie && (this.major == 2));
	this.ie4  = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
	this.win   = (agent.indexOf("win")!=-1);
	this.mac   = (agent.indexOf("mac")!=-1);
	this.unix  = (agent.indexOf("x11")!=-1);
}
var is = new Is();function addBookmark(title,url) {
    if (window.sidebar) { 
            window.sidebar.addPanel(title, url,""); 
    } else if( document.all ) {
            window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
            return true;
    }
}
if (window.LoadUserSetting) {
    var valCookie=LoadUserSetting('Normal');
}
if (window.valCookie) {
    changeTextSize('Normal',valCookie);
}
if(valCookie=="Small"){
    newClass="Small";   
}else if(valCookie=="Large"){
    newClass="Large"; 
}else{
    newClass="Normal";
}
function changeTextSize(id,newClass) {
    identity=document.getElementById(id);
    if (identity) {
        identity.className=newClass;
    }
}
function SaveUserSetting(property, value) {
	SetCookie(property,value); 
}
function LoadUserSetting(property) {
	return GetCookie(property);
}
function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
		if(is.ie) {
			if (document.cookie.substring(i, j) == arg) return arg;    
		}else{
			if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    
		}
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
		}  
	return null;
}
function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + value +          
		((expires == null) ? ""         : ("; expires=" + expires.toGMTString())) + 
		((path == null)    ? "; path=/" : ("; path=" + path)) +  
		((domain == null)  ? ""         : ("; domain=" + domain)) +    
		((secure == true)  ? "; secure" : "");
}	
function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
function sendPage(){
    mail_str = "mailto:?";
    mail_str += "body=" + "You have been sent a link from RJM Photographic; Creativity with the personal touch " + location.href + "%0D%0A%0D%0ARegards%0D%0A%0D%0ARick";
    location.href = mail_str;
}

