

<!--

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) { //v4.01

  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);

  if(!x && d.getElementById) x=d.getElementById(n); 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];}

}

//-->

<!-- //  Image Border RollOver



function over(cell){

cell.style.backgroundColor = "#7993A5";

//cell.className = class;

}

function out(cell){

cell.style.backgroundColor = "#FFFFFF";

//cell.className = class;

}

function out2(cell){

cell.style.backgroundColor = "#FFFFFF";

}

function testover(cell){

cell.style.border = "1px outset #FF6633";

}

function testout(cell){

cell.style.border = "0" ;

}



//Change DIV Text 

function changediv (the_div, the_text) {

document.getElementById(the_div).innerHTML=the_text

}



function changeimg (the_id, the_img) {

document.getElementById(the_id).src = the_img

}



// -->



/*******************************************************************************

   Form Validation

*******************************************************************************/



function validateme(){

	var myemail

	var strmyemail=document.emailForm.FromEmail.value ;

	var strfremail=document.emailForm.FriendEmail.value;

	var strmyname=document.emailForm.FromName.value ;

	var strfrname=document.emailForm.FriendName.value ;

	var flgreturn1,flgreturn2,flgreturn3,flgreturn4

	

	

	if ( ! IsAlphabitic(strmyname)){

		document.getElementById("myname").innerHTML="<center><img src=images/templates/reddot.gif></center>" ;

	flgreturn1=0;}

	else{ document.getElementById("myname").innerHTML="";flgreturn1=1;}

	

	if ( ! validateEmail(strmyemail)){

	document.getElementById("myemail").innerHTML="<center><img src=images/templates/reddot.gif></center>" ;

	flgreturn2=0;}

	else {

	document.getElementById("myemail").innerHTML="";flgreturn2=1;

	}

	if ( ! validateEmail(strfremail)){

	document.getElementById("femail").innerHTML="<center><img src=images/templates/reddot.gif></center>" ;

	flgreturn3=0;}

	else {

	document.getElementById("femail").innerHTML="";flgreturn3=1;

	}

		

	if ( ! IsAlphabitic(strfrname)){

	document.getElementById("fname").innerHTML="<center><img src=images/templates/reddot.gif></center>" ;

	flgreturn4=0;}

	else{

	document.getElementById("fname").innerHTML="" ;flgreturn4=1;}

	

	

	if (flgreturn1==0 ||flgreturn2==0 ||flgreturn3==0 ||flgreturn4==0){return false}else{return true}

	

}



function validateEmail(src) {

	if (src==""){return false;}

	else{ var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;

		if(! regex.test(src)){ return false; }else{ return true;}

	}

}



function IsAlphabitic(mystr){



var allvalid

var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz";

var checkStr = mystr ;

	if (mystr==""){allvalid=0}

	else{

	

		for (i = 0;  i < checkStr.length;  i++){

		ch = checkStr.charAt(i);

			for (j = 0;  j < checkOK.length;  j++){

				if (ch == checkOK.charAt(j)){ allvalid = 1 ; ;break;	}

				else{ allvalid= 0 ;}

			}



		}

	}

	if (allvalid == 0){return false;}else{return true;}

}







/*******************************************************************************

   Popup Window openers

*******************************************************************************/



var winReference = null;





// Open a window at a given position on the screen

function openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName) {



   // ie4.5 mac - windows are 2 pixels too short; if a statusbar is used, the window will be an additional 15 pixels short

   var agent = navigator.userAgent.toLowerCase();

   if (agent.indexOf("mac")!=-1 && agent.indexOf("msie") != -1 && agent.indexOf("msie 5.0")==-1) {

      height += 2;

      if (status) height += 15;

   }



   // Adjust width if scrollbars are used (pc places scrollbars inside the content area; mac outside)

   width += (scrollbars != '' && scrollbars != null && agent.indexOf("mac") == -1) ? 16 : 0;



   var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ',scrollbars' + ((scrollbars) ? '' : '=no') + ((moreProperties) ? ',' + moreProperties : '');

   var reference = openWindow(url, name, properties, openerName);



   // resize window in ie if we can resize in ns; very messy

   // commented out because openPositionedWindow() doesn't set the resizable attribute

   // left in for reference

   /*if (resizable && agent.indexOf("msie") != -1) {

      if (agent.indexOf("mac") != -1) {

         height += (status) ? 15 : 2;

         if (parseFloat(navigator.appVersion) > 5) width -= 11;

      }

      else {

         height += (status) ? 49 : 31;

         width += 13;

      }

      setTimeout('if (reference != null && !reference.closed) reference.resizeTo(' + width + ',' + height + ');', 150);

   }*/



    return reference;

}





// Open a window at the center of the screen

function openCenteredWindow(url, name, width, height, status, scrollbars, moreProperties, openerName) {

   var x = 0;

   var y = 0;

   if (screen) x = (screen.availWidth - width) / 2;

   if (screen) y = (screen.availHeight - height) / 2;

   if (!status) status == '';

   if (!openerName) openerName == '';

   var reference = openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName);

   return reference;

}





// Open a full-screen window (different from IE's fullscreen option)

function openMaxedWindow(url, name, scrollbars, openerName) {

   var width  = 600;

   var height = 800;

   if (screen) width  = screen.width - 10;

   if (screen) height = screen.height - 30;

   var reference = openPositionedWindow(url, name, width, height, 0, 0, false, scrollbars, openerName, moreProperties);

   return reference;

}





// Open a full-chrome (all GUI elements) window

// This is like using a target="_blank" in a normal link but allows focussing the window

function openFullChromeWindow(url, name, openerName) {

   return openWindow(url, name, 'directories,location,menubar,resizable,scrollbars,status,toolbar');

}





// Core utility function that actually creates the window and gives focus to it

function openWindow(url, name, properties, openerName) {



   // ie4.x pc can't give focus to windows containing documents from a different domain

   // in this case, initially load a local interstisial page to allow focussing before loading final url

   var agent = navigator.userAgent.toLowerCase();

   if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) == 4 && agent.indexOf("msie 5") == -1 && agent.indexOf("msie5") == -1 && agent.indexOf("win") != -1 && url.indexOf('http://') == 0) {

      winReference = window.open('about:blank', name, properties);



      setTimeout('if (winReference && !winReference.closed) winReference.location.replace("' + url + '")', 300);

   }

   else {



	//alert('window.open(' + url + ', ' + name + ', ' + properties + ');');



      winReference = window.open(url, name, properties);

   }



   // ie doesn't like giving focus immediately (to new window in 4.5 on mac; to existing ones in 5 on pc)

   setTimeout('if (winReference && !winReference.closed) winReference.focus()', 200);



   if (openerName) self.name = openerName;

   return winReference;

}





function openOutsideURL(openThisURL,Folder,OIID,wd,ht) {

   var urlRoot = "";  // a variable to hold just the www.wherever.com section of the URL

   if (openThisURL.indexOf("http://") == 0) {

      urlRoot = openThisURL.substr(7); // no second parameter means include the rest of the string

      // now trim off excess code

      if (urlRoot.indexOf("/") != -1) {

         urlRoot = urlRoot.substring(0,urlRoot.indexOf("/")); //

      }

   } else if (openThisURL.indexOf("/") != -1) {

      urlRoot = openThisURL.substring(0,openThisURL.indexOf("/"));

   }

      openCenteredWindow('/' + Folder + '/' + openThisURL + '&OIID=' + OIID,'small',wd,ht);

//   }

   return;

}





/*******************************************************************************

   Modal Dialog controls

*******************************************************************************/



// Close a dialog

// Call from onunload event handler of any page that can create a dialog

function closeDialog(dialog) {

   if (dialog && dialog.closed != true) dialog.close();

}





// Close parent popup

// Call from onload event handler of any page that could be created from a dialog

function closeParentDialog() {

   if (top.opener && isWindowPopup(top.opener)) {

      root = top.opener.top.opener;

      top.opener.close();

      top.opener = root;

   }

}





// Check if a window is a popup

function isWindowPopup(win) {

   return ((win.opener) ? true : false);

}





var It = 0;

var Its = new Object;

function SelectItem(cell){

if (It == 0 ){

	Its = cell

Its.style.border = "3px dashed #FF6633";

	It = 1

}

else {

	Its.style.border = 0

	cell.style.border = "3px dashed #FF6633";

	Its = cell

}

}



function SelectGiftCard(cell,id){

if (It == 0 ){

	Its = cell

Its.style.border = "2px dashed #FF6633";

	It = 1

	document.forms.GiftWrap.GiftCardImage.value = id;

	//alert ("cell d" + id);

}

else {

	Its.style.border = 0

	cell.style.border = "2px dashed #FF6633";

	Its = cell

	document.forms.GiftWrap.GiftCardImage.value = id;

	//alert ("cell 3" + Its);

}

}



function SelectVariant(cell,id,the_value){

if (It == 0 ){

	Its = cell;

	//over(Its);

	//Its.style.bgcolor = "#7993A5";

//	Its.style.border = "1px solid #7993A5";

	

	Its.style.fontWeight = 'bold';

//	if (document.getElementById) {

//    document.getElementById(Its).style.fontWeight = 'bold';

//  }

//  else if (document.all) {

//    document.all[Its].style.fontWeight = 'bold';

//  }





It = 1;

	//document.forms.ADDTOCART.id.value = the_value;

	document.getElementById(id).value = the_value;

	//alert ("id =" + id + " & the_value = " + the_value);

	//button_addtobag.style.visibility = "visible";

}

else {

	Its.style.border = 0;

	//Its.style.backgroundcolor = 0;

//	cell.style.border = "1px solid #7993A5";

	Its.style.fontWeight = 'normal';

	cell.style.fontWeight = 'bold';

/*	if (document.getElementById) {

    document.getElementById(cell).style.fontWeight = 'normal';

  }

  else if (document.all) {

    document.all[cell].style.fontWeight = 'normal';

  }

*/	

	

	Its = cell;

	document.getElementById(id).value = the_value;

	//document.forms.ADDTOCART.id.value = the_value;

	//alert ("cell 3" + Its);

}

}







function CountChar(mytext){

var charleft ;

charleft = 160 - mytext.value.length

charleft = charleft + " " + "left"

document.getElementById('leftchar').innerHTML = charleft ;

}





function openOutsideURLLF(openThisURL,Folder,PopUpType,OIID,wd,ht,prodname) {

   var urlRoot = "";  // a variable to hold just the www.wherever.com section of the URL

   if (openThisURL.indexOf("http://") == 0) {

      urlRoot = openThisURL.substr(7); // no second parameter means include the rest of the string

      // now trim off excess code

      if (urlRoot.indexOf("/") != -1) {

         urlRoot = urlRoot.substring(0,urlRoot.indexOf("/")); //

      }

   } else if (openThisURL.indexOf("/") != -1) {

      urlRoot = openThisURL.substring(0,openThisURL.indexOf("/"));

   }

      openCenteredWindow(PopUpType + '.asp?OIID=' + OIID,'small',wd,ht);

// }

   return;

}





function processorder(hideit,showit) {

	hideit.style.visibility = "hidden";

	showit.style.visibility = "visible";

}





IE = navigator.appName=="Microsoft Internet Explorer"; 

NS = navigator.appName=="Netscape"; 

bVer = parseInt(navigator.appVersion); 

var newWin=null; 

//------------------------------------------------------------------------------------------------------------->>

// BEGIN popup DEFINITION ------------------------------------------------------------------------------------->>

function popup(loc, name, width, height) {



       var _params = "width="+width+",height="+height+",resizable=no,status=no"; 



       // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2 

       if (bVer >= 4) { 

                _left = ( (screen.width-width) >>1 ); 

                _top = ( (screen.height-height) >>1 ); 

       } else { 

                _left = ( (2-width) >>1 ); 

                _top = ( (2-height) >>1 ); 

       } 



       if (IE) _params += ",top=" + _top + ",left=" + _left; 

       else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top; 



       newWin = window.open(loc, name, _params); 

       if ( newWin!=null && !(IE && bVer<5) ) 

               newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS 

}

// END popup DEFINITION --------------------------------------------------------------------------------------->>









function openOutsideURL_jump(openThisURL) {



   // see if the URL is a nintendo family



   // obtain just the first part of the url



   var urlRoot = "";  // a variable to hold just the www.wherever.com section of the URL



   if (openThisURL.indexOf("http://") == 0) {



      urlRoot = openThisURL.substr(7); // no second parameter means include the rest of the string



      // now trim off excess code



      if (urlRoot.indexOf("/") != -1) {



         urlRoot = urlRoot.substring(0,urlRoot.indexOf("/")); //



      }



   } else if (openThisURL.indexOf("/") != -1) {



      urlRoot = openThisURL.substring(0,openThisURL.indexOf("/"));



   }



//   if (nintendoFamilyURLs.indexOf(urlRoot) != -1) {



      // if it is, then just open up a new window



//       openFullChromeWindow(openThisURL, 'othersite');



//   } else {



     // if it is not, then popup the warning



      popup('/store/leaving.asp?url=' + openThisURL,'small',400,320);



//   }



   return;



}



// END openOutsideURL DEFINITION ------------------------------------------------------------------------------>>





function openOutsideURL_UPS(itracking) {



   // see if the URL is a nintendo family



   // obtain just the first part of the url

var openThisURL

  

   openThisURL="http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&sort_by=status&tracknums_displayed=5&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1="+itracking+"&InquiryNumber2=&InquiryNumber3=&InquiryNumber4=&InquiryNumber5=&AgreeToTermsAndConditions=yes&track.x=33&track.y=13"

     popup('/store/leaving.asp?url=' + openThisURL,'small',400,320);



//   }



   return;



}



// END openOutsideURL DEFINITION ------------------------------------------------------------------------------>>

