function change(what){
	tab = "tab_";
	info = "info_";
	var i = 1;
	while (1) {
		if(!document.getElementById(tab + i)){break;}
		var id = tab+i;
		var idb = info+i;
		document.getElementById(id).className="tab";
		document.getElementById(idb).style.display="none";
		i++;
	}
	id = tab+what;
	idb = info+what;
	document.getElementById(id).className="tab_a";
	document.getElementById(idb).style.display="block";
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function $import(path, type){
	if(type == "script"){
    create = document.createElement('script');
		create.setAttribute('type' , 'text/javascript');
		create.setAttribute('src' , path);
		document.getElementsByTagName('head')[0].appendChild(create);
	}else{
		create = document.createElement('link');
		create.setAttribute('rel' , 'stylesheet');
		create.setAttribute('type' , 'text/css');
		create.setAttribute('href' , path);
		document.getElementsByTagName('head')[0].appendChild(create);
	}
}

function $remove(id){
	var head = document.getElementsByTagName('head').item(0);
	var old = document.getElementById(id);
	if (old) head.removeChild(old);
}

function intSideNav(){
	var x=document.getElementById('slideContent');
	if((screen.width<=1024) && (screen.height<=768)){
    document.getElementById('slideContent').style.display="none";
	} else {
		if(!window.ActiveXObject){
			$remove('iecss');
			$import("/css/hires.css", "css");
		}
	}
}
function sendIt(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var what = document.getElementById("formEmail").value;
	if(what==null||what==""||what=="Email Address"||filter.test(what)==false){
		alert("Please enter a valid email address");
		document.getElementById("formEmail").focus();
	}else{
	document.quoteRequest.submit();
	}
}

function changeBlur(id){
	var elm = document.getElementById(id)
	if (elm.value == ""){
		elm.value=elm.title;
		elm.className='navFormInputGrey';
	}	
}
function changeFocus(id){
	var elm = document.getElementById(id);
	if (elm.value == elm.title){
		elm.value="";
		elm.className='navFormInput';
	}
}

function initChat(){
	document.getElementById('liveChat').innerHTML="<div id=\"l2s_trk\" style=\"z-index:99;visibility:hidden;\"><a href=\"http://live2support.com\" style=\"size:1px;\">Live chat hosted software</a></div>";
	var trig = $import('http://live2support.com/js/lsjs1.php?stid=10673','script');
}

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function CreateBookmarkLink(){
title = "USB Memory Direct - Promotional Wholesale USB Drives"; 
url = document.location.href;
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
} 
else if(document.all)// ie
window.external.AddFavorite(url, title);
else
alert("Press Ctrl+D to bookmark this page.");
}