var supported = (document.getElementById || document.all);

if (supported)
{
	document.write("<STYLE TYPE='text/css'>");
	document.write("#tree li ul, .header {display: none}");
	document.write("</STYLE>");

}

function change(i)
{
	if (document.getElementById)
	{
		document.getElementById(i).className = (document.getElementById(i).className == 'open') ? '': 'open';
	}
	else if (document.all)
	{
		document.all[i].className = (document.all[i].className == 'open') ? '': 'open';
	}
}

function addBookmark (title,url) 
{
	window.external.AddFavorite (url, title);
}

function pulldown_menu ()

{
    var url = document.pulldown.selectname.options [document.pulldown.selectname.selectedIndex].value
    
    if (url != "none") window.location.href = url
}

function pulldown_menu2 ()

{
    var url = document.pulldown2.selectname.options[document.pulldown2.selectname.selectedIndex].value
    
    if (url != "none") window.location.href = url
}

function hide_check() {

 if (document.getElementById || document.all){
  document.getElementById("alert_js").style.display="none";
 }
 else if (document.layers) {
  document.all["alert_js"].style.display="none";
 }
 else return;
}




// Hide Upgrade Option DIV

function setVisibility(id, visibility) {
	document.getElementById(id).style.display = visibility;
}


function submit_order(obj, frm) {
	if ( getBrowserName() == 'msie' || getBrowserName() == 'firefox' || getBrowserName() == 'mozilla' || getBrowserName() == 'opera' ) {
		obj.disabled=true;
		try {
			document.getElementById(frm).submit();	
		} catch(e) {
		
		}
	}
}


// Disable Submit Button After Clicked Once

function submit_order(obj, frm) {
	if ( getBrowserName() == 'msie' || getBrowserName() == 'firefox' || getBrowserName() == 'mozilla' || getBrowserName() == 'opera' ) {
		obj.disabled=true;
		try {
			document.getElementById(frm).submit();	
		} catch(e) {
		
		}
	}
}


// Disable Right Hand Clik


var message="All Content is Copyright (c) 2008 QualityGenerics.com. No Reproductions Without Permission Please"; //
function click(i) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (i.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;



// Disable Right-Hand Click FireFox


var message="All Content is Copyright (c) 2008 QualityGenerics.com. No Reproductions Without Permission Please";

function clickIE()
 
{if (document.all)
{(message);return false;}}
 
function clickNS(e) {
if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.  onmousedown=clickNS;}
else
{document.onmouseup=clickNS;document.oncontextmenu  =clickIE;}
 
document.oncontextmenu=new Function("return false")






// REFERER DETECT FOR CA.CLICKINC.COM

	var affSoft_scriptLoc = 'http://ca.clickinc.com/clicks/servlet/Click?merchant=70138';
	var affSoft_kbId = 0;
	var affSoft_queryString = window.location.search.substring(1);
	var affSoft_imgdata = '';
	var affSoft_subdata = '';
	var affSoft_promodata = "";
	var affSoft_overwrite = 0;
	var affSoft_refdata = document.referrer;
	var affSoft_daysToLive = 365;
	var affSoft_affReferralValue = "";
	var multiDomain = false;
	if (affSoft_queryString.length > 0) {
		var pairs = affSoft_queryString.split('&');
								
		for(var i = 0; i < pairs.length; i++) {
			var pairs2 = pairs[i].split('=');
			
			switch(pairs2[0].toLowerCase()) {
				case 'affid':
					affSoft_kbId = pairs2[1];
					break;
				case 'kbid':
					affSoft_kbId = pairs2[1];
					break;
				case 'id':
					if(affSoft_kbId==0){
						affSoft_kbId = pairs2[1];
					}
					break;
				case 'img':
					affSoft_imgdata = pairs2[1];
					break;
				case 'sub':
					affSoft_subdata = pairs2[1];
					break;
				case 'promotion':
					affSoft_promodata = pairs2[1];
					break;
				case 'affreferral':
					affSoft_affReferralValue = pairs2[1];
					break;
			}
		} //end for
	}//end if

// checking for the click Id and same Click or not 

if (affSoft_promodata != ""){
	SetCookie("promotion", affSoft_promodata, affSoft_daysToLive);
 }
 
 if ( aff_IsNewCustomer()==true ) { //aff_IsAffiliateClick()==true && 
		aff_Post();
		// Store a flag in the form of a cookie
		if ( affSoft_kbId != null ) {
			SetCookie("asm", affSoft_kbId, affSoft_daysToLive);
		}
		if (affSoft_affReferralValue != null && affSoft_affReferralValue != "") {
			SetCookie("affreferral", affSoft_affReferralValue, affSoft_daysToLive);
		}
		SetCookie("asmReferral", affSoft_refdata, affSoft_daysToLive);
 }

/*
function aff_IsAffiliateClick() { 
	if (affSoft_kbId!=null && affSoft_kbId!=0) {
		return true;
	} else {
		return false;
	}
 }
*/

function aff_IsNewCustomer() { 
	if ( GetCookie('asm')==null && GetCookie('asmReferral')==null ) {
		return true;
	} else {
		return false;
	}
}
		
//Posting Click
function aff_Post() {

	var img = new Image();
	var url = affSoft_scriptLoc + '&affId=' + affSoft_kbId;
	if (affSoft_imgdata != '') 	{
		url += '&img=' + affSoft_imgdata+'&type=banner';
	} else {
		url +='&type=text';
	}
    if (affSoft_subdata != '') {
		url += '&sub=' + affSoft_subdata;
	}
	if (affSoft_refdata != '') {
		url += '&referrer=' + affSoft_refdata;
	}	
    img.src = url;	
}
	function getCookieVal (offset) 
	{
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
			endstr = document.cookie.length;

		return unescape(document.cookie.substring(offset, endstr));
	}

	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 (document.cookie.substring(i, j) == arg)
				return getCookieVal (j);
			
			i = document.cookie.indexOf(" ", i) + 1;

			if (i == 0) break; 
		}
		
		return null;
	}

	function WriteCookie (name, value, expires) 
	{
		var argv = SetCookie.arguments;
		var argc = SetCookie.arguments.length;
		var path = "/";

			//inserted by Andrew Herron to fix cross-sub-domain cookie compatibility, 
			if (multiDomain) {
				rootDomain = document.domain;
			} else {
				domain = document.domain;
				dparts = domain.split(".");
				if (dparts.length == 3) {
					rootDomain = dparts[1]+"."+dparts[2];
				} else {
					rootDomain = domain;
				}
			}

		var secure = (argc > 5) ? argv[5] : false;
		
		var cookie = name + "=" + escape(value) +
			((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
			((path == null) ? "" : ("; path=" + path)) +
			((rootDomain == null) ? "" : ("; domain=" + rootDomain)) +
			((secure == true) ? "; secure" : "");
		
		document.cookie = cookie;
	}

	function DeleteCookie (name) 
	{
		var exp = new Date();
		exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
		var cval = GetCookie (name);
		document.cookie =name + "=" + cval + "; expires=" + exp.toGMTString();
	}

	function SetCookie(name, value, expiredays)
	{
		var expdate = new Date(); 
		expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * expiredays)); 
		WriteCookie(name, value, expdate);  
	}

	
function submitAction(form){
	form.referedBy.value= GetCookie('asm');
	form.referedUrl.value = GetCookie('asmReferral');
	form.submit();
}