//ITZ E-commerce Javascript Library
document.write('<script type="text/javascript" src="/incs/editor/scripts/innovaeditor.js"><\/script>'); 
document.write('<script type="text/javascript" src="/incs/lightbox/prototype.js"><\/script>');
document.write('<script type="text/javascript" src="/incs/lightbox/scriptaculous.js?load=effects"><\/script>');
document.write('<script type="text/javascript" src="/incs/lightbox/lightbox.js"><\/script>');
document.write('<script type="text/javascript" src="/incs/lightbox/effects.js"><\/script>');
document.write('<script type="text/javascript" src="/incs/charting.js"><\/script>');
document.write('<script type="text/javascript" src="/incs/tabs.js"><\/script>');

function selectProdImage(){
	sActiveAssetInput = document.getElementById("prodPic");
	if(navigator.appName.indexOf('Microsoft')!=-1){
		sActiveAssetInput.value=modalDialogShow_IE("/incs/editor/assetmanager/assetmanagerprods.asp",640,465); //IE	
		VarImageName = sActiveAssetInput.value
		document.getElementById("ProductImage").src = document.getElementById("imagePath").value + VarImageName;
		}
	else {
		modalDialogShow("/incs/editor/assetmanager/assetmanagerprods.asp",640,445); //Moz	
	}
	}
function selectGalImage(){
	sActiveAssetInput = document.getElementById("galImage");
	if(navigator.appName.indexOf('Microsoft')!=-1){
		sActiveAssetInput.value=modalDialogShow_IE("/incs/editor/assetmanager/assetmanagergal.asp",640,465); //IE	
		VarImageName = sActiveAssetInput.value
		document.getElementById("GalleryImage").src = document.getElementById("imagePath").value + VarImageName;
		}
	else {
		modalDialogShow("/incs/editor/assetmanager/assetmanagerGal.asp",640,445); //Moz	
	}
	}	
function selectCatImage(){
sActiveAssetInput = document.getElementById("catPic");
if(navigator.appName.indexOf('Microsoft')!=-1){
	sActiveAssetInput.value=modalDialogShow_IE("/incs/editor/assetmanager/assetmanagercats.asp",640,465); //IE	
	VarImageName = sActiveAssetInput.value
	}
else {
	modalDialogShow("/incs/editor/assetmanager/assetmanagercats.asp",640,445); //Moz	
}
}
function setAssetValue(v) {
	if (document.getElementById("prodPic")) {
    document.getElementById("prodPic").value = v;
	}
	if (document.getElementById("galImage")) {
    document.getElementById("galImage").value = v;
	}
	if (document.getElementById("catPic")) {
    document.getElementById("catPic").value = v;
	}
	if (document.getElementById("ProductImage")) {
	document.getElementById("ProductImage").src = document.getElementById("imagePath").value + v;
	}
	if (document.getElementById("GalleryImage")) {
	document.getElementById("GalleryImage").src = document.getElementById("imagePath").value + v;
	}
}
function modalDialogShow_IE(url,width,height) //IE
	{
	return window.showModalDialog(url,window,
		"dialogWidth:"+width+"px;dialogHeight:"+height+"px;edge:Raised;center:Yes;help:No;Resizable:Yes;Maximize:Yes");
	}

function addToFavorite(favTitle){
  if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) {
    window.external.AddFavorite(location.href, unescape(favTitle));
  }
}
function clearField(){
if (document.ShopSearch.s.value == " Search")
	document.ShopSearch.s.value = "";
}
function prodPopupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,screenX=150,screenY=150,top=50,left=50')
}


function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = theElement.checked;
	  }
     }
    }
	
function checkUncheckSome(controller,theElements) {
	
     var formElements = theElements.split(',');
	 var theController = document.getElementById(controller);
	 for(var z=0; z<formElements.length;z++){
	  theItem = document.getElementById(formElements[z]);
	  if(theItem){
	  if(theItem.type){
        if(theItem.type == 'checkbox' && theItem.id != theController.id){
	     theItem.checked = theController.checked;
	    }
	  } else {

	    var nextArray = '';
	     for(var x=0;x <theItem.childNodes.length;x++){
	      if(theItem.childNodes[x]){
	        if (theItem.childNodes[x].id){
	          nextArray += theItem.childNodes[x].id+',';
		    }
	      }
	     }
	     checkUncheckSome(controller,nextArray);
	   
	   }
	  
	  }
     }
    }
	
	
function KeyDownHandler(evnt,btn)
{
	// process only the Enter key
	if (evnt.keyCode == 13)
	{
		// cancel the default submit
		 evnt.returnValue=false;
		 evnt.cancel = true;
		// submit the form by programmatically clicking the specified button
		btn.click();
	}
}
function sf()
{
if (document.LoginForm)
{
document.LoginForm.userLogin.focus();
}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function openPostage(){
window.open("","_postage","toolbars=0,location=0,width=355,height=210");
return true;
}



