
function SetRegisteredCookie()
{
		var expdate = new Date ();
		FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
		expdate.setTime (expdate.getTime() + (10 * 365 * 24 * 60 * 60 * 1000)); // 10 years from now
		SetCookie ("CrystalSiteRegCookie", true, expdate, "/");
}


function urlPopup(url, title, height, width, scrollbars, resizable)
{
	scrollbars = (typeof(scrollbars) != 'undefined') ? scrollbars : '0';
	resizable  = (typeof(resizable)  != 'undefined') ? resizable  : '0';
	 
	CurrencyWindow = window.open ('', title, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + scrollbars + ',resizable=' + resizable + ',height=' + height + ',width=' + width);
	CurrencyWindow.focus();
	CurrencyWindow.location.href = url;
}


function currencyPopup(QueryString)
{
//	CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height=170,width=600');
//	CurrencyWindow.focus();
//	CurrencyWindow.location.href = 'http://www.xe.com/ecc/input.cgi?Template=sw&'+QueryString;
	urlPopup('http://www.xe.com/ecc/input.cgi?Template=sw&' + QueryString, 'CurrencyWindow', 170, 600);
}


function imagePopup(imageurl)
{
	imageWindow = window.open (imageurl, 'Image', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height=480,width=640');
	imageWindow.focus();
}


function imgWindow (imgurl, win, width, height, restitle, caption)
{
	horz = width + 20;
	vert = height + 125; 
	
	imgwin = window.open ('', win, 'resizable=no,toolbar=no,menubar=no,width=' + horz + ',height=' + vert );
	imgwin.document.writeln ('<html><head><title>' + restitle + '</title></head>');
	imgwin.document.writeln ('<body>');
	imgwin.document.writeln ('<div style="text-align:center;margin-left:auto;margin-right:center;">');
	imgwin.document.writeln ('<img src="' + imgurl + '" width="' + width + '" height="' + height + '" alt="' + restitle + '"border=1"' + '">');
	imgwin.document.writeln ('<div style="font:12px Verdana, Geneva, Arial, Helvetica, sans-serif;">' + '<br>' + caption + '</div>');
	imgwin.document.writeln ('<div style="margin:12px;width:100px;margin-right:0;">');
	imgwin.document.writeln ('<a href="javascript:window.parent.close();" ');
	imgwin.document.writeln ('style="text-align:center;font:bold 12px Verdana, Geneva, Arial, Helvetica, sans-serif;text-transform:uppercase;">');
	imgwin.document.writeln ('Close Image</a></div></div>');
	imgwin.document.writeln ('</body></html>');
	imgwin.document.close();
	
	if (window.focus) {
		imgwin.focus()
	}
}


/*
//Bread crumb script - Kevin Lynn Brown
//Duplicate directory names bug fix by JavaScriptKit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Modified by Daniel Vidoni 2004
function breadCrumbsSimple()
{
	var path = "";
	var href = document.location.href;
	var s = href.split("/");
	for (var i=3;i<(s.length-1);i++) {
		path+=" / <A HREF=\""+href.substring(0,href.indexOf("/"+s[i])+s[i].length+1)+"/\">"+s[i]+"</A>";
	}
	i=s.length-1;
	path+=" / <A HREF=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"\">"+s[i]+"</A>";
//	var url = window.location.protocol + "//" + path;
	var url = path;
	document.writeln(url);
}
*/


//Modified by Biju 2004
function breadCrumbsSimple()
{
	var path = "";
	var href = document.location.href;
	var s = href.split("/");
	for (var i=3;i<(s.length-1);i++) {
		path+=" / <A HREF=\""+href.substring(0,href.indexOf("/"+s[i])+s[i].length+1)+"/\">"+s[i]+"</A>";
	}
	i=s.length-1;
	str_last_name=s[i].split(".")
	path+=" / <A HREF=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"\">"+str_last_name[0]+"</A>";
//	var url = window.location.protocol + "//" + path;
	var url = path;
	document.writeln(url);
}




function showDate()
{
		var months=new Array(13);
		months[1]="January";
		months[2]="February";
		months[3]="March";
		months[4]="April";
		months[5]="May";
		months[6]="June";
		months[7]="July";
		months[8]="August";
		months[9]="September";
		months[10]="October";
		months[11]="November";
		months[12]="December";
		
		var time=new Date();
		var lmonth=months[time.getMonth() + 1];
		var date=time.getDate();
		var year=time.getYear();

		if (year < 2000)    // Y2K Fix, Isaac Powell
			year = year + 1900; // http://onyx.idbsu.edu/~ipowell

		document.write("<right>" + lmonth + " ");
		document.write(date + ", " + year + "</right>");
}

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_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}



/*
============================================================
Script:     Random Quote

Functions:  This simple script allows you to print random
            quotations in the page.  Any number of quotes
            may be used.
            
Browsers:   All

Author:     etLux
============================================================

NOTE:
	In quotation 8, note the text, \"beauty\" -- if you need
	to use double-quote " marks, you *must* precede each
	double-quote with a backslash \... otherwise the script
	will break.
*/

// ==============================================
// Copyright 2004 by CodeLifter.com
// Free for all; but please leave in this header.
// ==============================================

function showQuotation1()
{
	var Quotation=new Array();
	
	// Set up the quotations to be shown, below.
	// To add more quotations, continue with the pattern, adding to the array.
	// Remember to increment the Quotation[x] index!

	Quotation[0] = "The smooth faces of crystals are caused by a regular internal arrangement of atoms.";
	Quotation[1] = "An oyster covers a grain of sand, layer upon layer for years on end, with the mineral aragonite until it produces a pearl. It is the aragonite that gives the pearl its lustre.";
	Quotation[2] = "Scientist suspect that diamonds and rubies are both formed in a region 125 miles below the earths’ surface.";
	Quotation[3] = "Dust is so hard that it actually scratches glass. Dust particles are mostly silicon-quartz, which is 7 to 7.5 on the Mohs scale of hardness. Dust will actually remove the finish on your car and the polish off your table as you wipe it off.";
	Quotation[4] = "Poor quality amethyst is a source of silica for making glass, paints and abrasives.";
	Quotation[5] = "Celestite is a Strontium Sulfate Mineral Crystal that is used to give Fireworks their Crimson Flame.";
	Quotation[6] = "The distinct green colouring revealing the presence of malachite is a reliable indication of where geologists should start digging for copper.";
	Quotation[7] = "Smoky quartz does not differ from clear quartz in chemical composition. In fact when it is heated to very high temperatures the “smoky” colour vanishes, and it looks identical to clear crystalline quartz. The colour can be restored by treating the crystal with a beam of x-rays.";
	Quotation[8] = "The colours of minerals and crystals result from light interacting with the different atoms present in their crystals. It doesn't matter what colour you see when they are whole, or how dark the colour is. If you ground up a sapphire, emerald or garnet you'd get a white powder.";
	Quotation[9] = "Scientists believe that the colour of smoky quartz is a result of natural radiation in the earth.";
	Quotation[10] = "Sunstone flashes of colour are caused by inclusions of hematite.";
	Quotation[11] = "Malachite occurs in the oxidation zone of copper deposits";
	Quotation[12] = "Quartz is the one of the most abundant minerals making up 12% of the earth's crust. It is a major component of sand and granite.";
	Quotation[13] = "Rose Quartz gets its pink colour from traces of manganese or titanium.";
	Quotation[14] = "Carnelian is a type of chalcedony who gets its red colouring from the presence of Hematite or Limonite inclusions.";
	Quotation[15] = "Obsidian gets is rich black colouring from extremely fine hematite or magnetite particles.";
	Quotation[16] = "Jasper is a variety of quartz, with tiny crystals visible in its structure when viewed under a microscope, and the presence of other minerals change the colours and appearance of all the types of jasper we experience.";
	Quotation[17] = "Piezoelectric the property of certain crystals that causes them to produce voltage when a mechanical pressure is applied to them such as sound vibrations. This technique is used to build crystal microphones, phonograph cartridges and strain gauges, all of which turn mechanical movement into voltage.";
	Quotation[18] = "Amethyst is the purple variety of quartz who can thank its glorious colour to the presence of iron.";
	Quotation[19] = "Feldspar is the most common and abundant mineral in igneous rocks.";
	
	var Q = Quotation.length;
	var whichQuotation=Math.round(Math.random()*(Q-1));
	
	document.write(Quotation[whichQuotation]);
}


function showQuotation2()
{
	var Quotation=new Array();

	// Set up the quotations to be shown, below.
	// To add more quotations, continue with the pattern, adding to the array.
	// Remember to increment the Quotation[x] index!
	
	Quotation[0] = "Flourite fades in Sunlight so don’t leave it on a window sill – it is best to keep your Flourite specimens out of sunlight as the colour you so value fades in time, when exposed to sunlight.";
	Quotation[1] = "Vivianite darkens with exposure to any type of light, natural or artificial, therefore specimens should be kept in a dark position or at best in a lightproof bag. Exposure to light accelerates oxidation of the vivianite's iron content and can darken a specimen to blackness.";
	Quotation[2] = "Malachite can be permanently damaged by the chemicals present in tap water and should only be washed in purified water.";
	Quotation[3] = "Things to look for when purchasing a specimen: That specimens have not been dyed or heated to intensify their colour (if they have that you know about it prior to purchasing).";
	Quotation[4] = "Things to look for when purchasing a specimen: That specimens have not been roasted and oiled to eliminate flaws and increase their transparency.";
	Quotation[5] = "Things to look for when purchasing a specimen: That specimens have not been cut to imitate well shaped crystals.";
	Quotation[6] = "Opals can be washed or soaked in water with no damage occurring to the specimen. However, soaking in water (especially warm with detergent) is not recommended for doublets and triplets as this can remove the glue that holds the protective face on the stone.";
	Quotation[7] = "Do not soak turquoise in water or use detergent to clean specimens. Always dry turquoise thoroughly after wiping clean with a damp cloth.";
	Quotation[8] = "Do not expose turquoise to extreme sunlight or heat, as turquoise may change colour. It is best to store specimens in a cool dry place.";
	Quotation[9] = "An easy way to tell a flawless, water Clear Quartz sphere from a glass one is to draw a straight line down a piece of paper, if the line is straight while looking through the sphere its glass. If the line bends or is not straight its Quartz! And Quartz is much colder then glass!";
	
	var Q = Quotation.length;
	var whichQuotation=Math.round(Math.random()*(Q-1));
	
	document.write(Quotation[whichQuotation]);
}
