//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com


//font size 
//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','table','tr','td','th','strong','a','span','li','ul');
var startSz=getFontSize();

function getFontSize() {
	if (document.cookie.indexOf("fontSize") < 0) {
		return 1;
	} else {
		var startStr = document.cookie.indexOf("fontSize") + 9;
		var endStr = document.cookie.indexOf(";", startStr);
		if (endStr == -1) {
			endStr = document.cookie.length;
		}
		return unescape(document.cookie.substring(startStr, endStr));
	}
}
		
function restFontSize(trgt)
{	//999 = rest
	changeFontSize( trgt, 999, 0 );
}
		
function changeFontSize( trgt, inc, type ) {
	
	//Specify spectrum of different font sizes:
	//var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
	if (type == 1) {
		var szs = new Array('100%','110%','120%','130%','140%','150%');
	} else {
		var szs = new Array('100%','110%','120%','130%','140%','150%');
		var smallSzs = '100%';
	}

	if (!document.getElementById) return
	
	var d = document,cEl = null,sz = eval(startSz),i,j,cTags;

	if (type == 0) {
		sz += inc;
	}

	if ( sz < 0 ) sz = 0;
	if ( sz > (szs.length-1) ) sz = (szs.length-1);
	if ( inc == 999) sz = 1; //rest font size
	startSz = sz;
	
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];
	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) {
			cTags[ j ].style.fontSize = smallSzs;
		}
	}
	if (type == 0) {
		setCookie("fontSize", sz, nd, cpath, cdomain);
	}
}


// cookie section
nd= new Date();
nd.setTime (nd.getTime()+(365*24*60*60*1000));
//cdomain = (location.domain) ? location.domain : null;
cdomain = (location.domain) ? location.domain : null;
cpath = "/";

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function getCookie(NameOfCookie)
{

// First we check to see if there is a cookie stored.
// Otherwise the length of document.cookie would be zero.

if (document.cookie.length > 0) 
{ 

// Second we check to see if the cookie's name is stored in the
// "document.cookie" object for the page.

// Since more than one cookie can be set on a
// single page it is possible that our cookie
// is not present, even though the "document.cookie" object
// is not just an empty text.
// If our cookie name is not present the value -1 is stored
// in the variable called "begin".

begin = document.cookie.indexOf(NameOfCookie+"="); 
if (begin != -1) // Note: != means "is not equal to"
{ 

// Our cookie was set. 
// The value stored in the cookie is returned from the function.

begin += NameOfCookie.length+1; 
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); } 
}
return null; 

// Our cookie was not set. 
// The value "null" is returned from the function.

}
 
 





function delCookie (NameOfCookie) 
{

// The function simply checks to see if the cookie is set.
// If so, the expiration date is set to Jan. 1st 1970.

if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
