<!--
var message="Copyright" + String.fromCharCode(169) + " 2003 by eWiz.com. \n\nWARNING ! All images & content contained within this site is protected by copyright laws. \n\nUnauthorized use of our material is strictly prohibited.";
var disable = false;
function click(e) {
  if (disable) {
	  if (document.all) {
	    if (event.button==2||event.button==3) {
	      alert(message);
	      return false;
	    }
	  } else if (document.layers) {
	    if (e.which == 3) {
	      alert(message);
	        return false;
	    }
	  }
  }
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
function on() {
  disable = true;
}
function off() {
  disable = false;
}

var caution = false
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" : "")
        if (!caution || (name + "=" + escape(value)).length <= 4000)
                document.cookie = curCookie
        else
                if (confirm("Cookie exceeds 4KB and will be cut!"))
                        document.cookie = curCookie
}

function getCookie(name) {
        var prefix = name + "="
        var cookieStartIndex = document.cookie.indexOf(prefix)
        if (cookieStartIndex == -1)
                return null
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
        if (cookieEndIndex == -1)
                cookieEndIndex = document.cookie.length
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}
function deleteCookie(name, path, domain) {
        if (getCookie(name)) {
                document.cookie = name + "=" + 
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                "; expires=Thu, 01-Jan-70 00:00:01 GMT"
        }
}

function fixDate(date) {
        var base = new Date(0)
        var skew = base.getTime()
        if (skew > 0)
          date.setTime(date.getTime() - skew)
}

function addCboCpn(cboid, combotype, part1, part2){
	    codestring = getCookie("CboCoupon");
	    if ((!codestring) || (codestring == "null") ||(codestring == "")) {
			setCookie("CboCoupon",cboid+":"+combotype+":"+part1+":"+part2+":", now);
		}
		else { 
				codestring += cboid+":"+combotype+":"+part1+":"+part2+":";
				setCookie("CboCoupon",codestring,now);
		}
}

function addMoreItem(itemName, channel, qty, balance){
	balance=1
	if (balance<=0){
//		alert("We are sorry, but this item is out of stock.");
//	   window.open("emailnotic.php?name="+itemName,"","menubar=0,toolbar=0,location=0,width=520,height=520");
       popWinMail("emailnotic.php?name="+itemName,"resizable,width=520,height=520");
		return false;
	}
	qty=parseInt(qty);
	if ((qty>0) && (qty!=NaN)){
		CustomerItems = getCookie("CurrentItems");
		if ((!CustomerItems) || (CustomerItems == "null")) {
			CustomerItems = qty + ":" + itemName + ":" + channel + ":";
			setCookie("CurrentItems", CustomerItems, now);
		}
		else {
			itemArray=CustomerItems.split(":");
			//search if item already in cart. If so update qty instead of adding new entry		
			for(var i=0;i<itemArray.length;i+=3){
				if ((itemName == itemArray[i+1]) && (channel==itemArray[i+2])){
					//alert("item in cart");
					//found item in cart, update qty only
					itemArray[i]=parseInt(itemArray[i])+qty;
					var newCustomerItems="";
					for(var j=0;j<itemArray.length-1;j++){
						newCustomerItems+=itemArray[j]+":";
					}
					setCookie("CurrentItems", newCustomerItems, now);
					return;
				}
			}
			//item not found in cart, add it
			//alert("item not in cart");
			CustomerItems += qty + ":" + itemName + ":" + channel +":";
			setCookie("CurrentItems", CustomerItems, now);
		}
	}
	return true;
}

var referWinMail;
function popWinMail(url, attr) {
  if (!referWinMail || referWinMail.closed) {
    referWinMail = window.open(url,"referWinMail", attr);
      if (!referWinMail.opener) {
        referWinMail.opener = window;
      }
  }
  referWinMail.focus();
  window.onunload = function(){referWinMail.close();}
  return true;
}

function addItem(itemName, channel, balance) {
	return addMoreItem(itemName, channel, '1', balance);
}

function addPrizeItem(itemName, channel, balance, price, avail) {
	if (price > avail) {
		alert("You don't have enough WizPoints available for this item.");
		return false;	
	}
	return addMoreItem(itemName, channel, '1', balance);
}

function addRfbMoreItem(itemName, channel, qty, balance){
	//alert("balnce: " + balance);
	
	
	if (balance < 1) {
		alert("We're sorry. Item " + itemName + " is not available");
		return false;
	} else if (qty > balance) {
		alert("We're sorry. You tried to add more items (#" + itemName +") than are available.\nAvailable item(s): " + balance);
		return false;
	}
	return addMoreItem(itemName, channel, qty, balance);
}

function addRfbItem(itemName, channel, balance) {
	return addRfbMoreItem(itemName, channel, '1', balance);
}

	
function addCoupon(code, codetype){
	if (codetype=="CPN"){
		removeCoupon();
	}
	if(code!="" && code!=null){
		CouponCode=getCookie("CouponCode");
		if (!CouponCode || (CouponCode == null)){
			setCookie("CouponCode",code+":"+codetype+":", now);
		}else{
			codeArray=CouponCode.split(":");
			//search if code is already stored
			for (var i=0; i<codeArray.length;i+=2){
				if (codeArray[i]==code){
					return;
				}
			}
			var newCodeStr=CouponCode+code+":"+codetype+":";
			setCookie("CouponCode",newCodeStr,now);
		}
	}
}


function removeCoupon(){
	CouponCode=getCookie("CouponCode");
	if ((CouponCode!=null) && (CouponCode != "")){
		var newCode="";
		codeArray=CouponCode.split(":");
		//search if code is already stored
		for (var i=0; i<(codeArray.length-1);i+=2){
			if (codeArray[i+1]!="CPN"){
				newCode+=codeArray[i]+":"+codeArray[i+1]+":";
			}
		}
		if (newCode==""){
			deleteCookie("CouponCode");
		}else{
			setCookie("CouponCode",newCode,now);
		}
	}
}	

var now = new Date()
var last
fixDate(now)
now.setTime(now.getTime() + 12 * 60 * 60 * 1000)

var msg = "KnowledgeMicro.com is optimized for Microsoft ® Internet Explorer (TM) 4 and higher or Netscape ® Navigator (TM)  4 and Higher."
msg += "  In order to enjoy the full benefits of KnowledgeMicro.com we recommend that you upgrade your browser."
var is_major = parseInt(navigator.appVersion);
var ready="no"
function notReady() {
if (document.referrer.indexOf("knowledgemicro.com") == -1)
	window.open("notReady.html","","menubar=0,toolbar=0,location=0,width=570,height=70");
}
function sure() {
var letak = document.location;
if (letak == "http://knowledgemicro.com/")
 	location.href="http://www.knowledgemicro.com/"; 
}

sure();

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function shopcart() {
	document.forms["shopcart"].submit();
}
function SearchClear() {
		// Clears the search text box once the user has clicked into it.
		if (document.form1.s.value == 'Keyword Search') 
			document.form1.s.value = '';
}
function SearchClearb()	{
		// Clears the search text box once the user has clicked into it.
		if (document.mailSupport.email.value == 'Enter your email address here') 
			document.mailSupport.email.value = '';
}
function SearchClearc()	{
		// Clears the search text box once the user has clicked into it.
		if (document.mailSupport.body.value == 'Write your questions here') 
			document.mailSupport.body.value = '';
}
function validateSearch()
{
   var fm = document.forms['form1']
   var textsearch = fm.elements['s']
   var textlength = (textsearch.value+"").length
   //textsearch = document.form1.s.value
   if (textsearch.value == "" || textsearch.value == "Keyword Search") {
	alert("Please enter the search keyword(s)");
	document.form1.s.select();
	return false;
   }
   //alert("You entered " + textsearch);
   else if (textlength < 3) {
	alert("You must enter at least 3 characters");
	document.form1.s.select();
	return false;
   }
   else {
  	//alert("Begin your search!");
	return true;
   }
   return true;
}

function loadBrand(brand) {
  location.href = "brand.php?brand=" + brand;
}
//-->

