function toggle( targetId ){
    	target = document.all( targetId );
  		if (target.style.display == "none"){
			target.style.display = "";
  		}
		 else {
			target.style.display = "none";
		}
}
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 + "=" + escape (value) +
      ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
}

//  Function to delete a cookie. (Sets expiration date to current date/time)
//    name - String object containing the cookie name
//
function DeleteCookie( name, path, domain ) {
if ( GetCookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


//  This is simply a 'worker' function used in the GetCookie
//  function.
function getCookieVal(offset) {
    var endstr = document.cookie.indexOf(";",offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset,endstr));
}
//  Call this function to return a selected cookie value.
//  Pass the function the name of the cookie value you
//  want to retrive.  It will return null if no value is
//  found.
function GetCookie(name) {
    var PT=name+"=";
    var PTLen=PT.length;
    var CookieLen = document.cookie.length;
    var i=0;
    while (i < CookieLen) {
        var j = i + PTLen;
        if (document.cookie.substring(i,j) == PT)
            return getCookieVal(j);
        i = document.cookie.indexOf(" ",i) + 1;
        if (i==0) break;
    }
    return null;
}
function SetImageEffect(EffectType) {
    var objSrc = window.event.srcElement;
	if (objSrc.id == "EffectPic") {
		if (EffectType == "Flip") {
			objSrc.style.filter="filter: fliph";
		}
		else if (EffectType == "Blur") {
			objSrc.style.filter="filter: blur(add=1, direction=45, strength=3)";
		}
		else if (EffectType == "Invert") {
			objSrc.style.filter="filter: invert";
		}
		else if (EffectType == "FlipV") {
			objSrc.style.filter="filter: flipv";
		}
		else if (EffectType == "GlowG") {
			objSrc.style.filter="filter: glow(color=00ff00, strength=5)";
		}
		else {
			objSrc.style.filter="filter: glow(color=ff0000, strength=5)";
		}
	}
}

function ResetStyle() {
  var objSrc = window.event.srcElement;
   if (objSrc.id == "EffectPic") {
    objSrc.style.filter="filter: none";
   }
}