document.write ('<style type="text/css">');
document.write ('#divContainer {font-family:Arial; font-size:12px; VISIBILITY: hidden; OVERFLOW: hidden; WIDTH:480px; CLIP: rect(0px 480px 315px 0px); POSITION: relative; HEIGHT: 315px; TOP: 0px; LEFT: 0px;}');
if (navigator.appVersion.indexOf("Mac") != -1) {
	document.write('#divContent{position:absolute; top:0; left:0;}');
} else {
	document.write('#divContent{position:relative; top:0; left:0;}');
}
document.write ('</style>');

function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 

 
var speed=50 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer') 
    objScroller=new ConstructObject('divContent','divContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 
// end absolutely positioned scrollable area object scripts 

//erase input box content
var effaced=0;
function efface (elem) {
	if (effaced == 1){
		elem.value='';
	}
	effaced=effaced+1;
}
//optin options
function openIT () {
	printWindow=window.open("/optin.html","_","height=300,width=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,history=no")
}
// open window
function newwin(page,name,attributes)
{
        window.open(page,name,attributes);
}
//function to validate by length
function validlength(item, len) {
   return (item.length >= len);
}
//function to validate an email address
function validemail(item) {
   if (!validlength(item, 5)) return false;
   if (item.indexOf ('@', 0) == -1) return false;
   return true;
}
// display an error alert
function error(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   elem.select();
   elem.focus();
   errfound = true;
}
// main validation function
function validate_optin() {
   errfound = false;
			if (!validemail(document.optin.email.value))
    			error(document.optin.email,"Sorry, Invalid Email Address!");

   return !errfound; /* true if there are no errors */
}

//Date
var time = new Date(), year;
year = time.getFullYear();

//erase imput box content
var effaced=0;
function efface (elem) {
	if (effaced == 1){
		elem.value='';
	}
	effaced=effaced+1;
}
// error class
function Errors() {
	this.errors = new Array();

	this.adderror = function(msg) {
		this.errors[this.errors.length] = msg;
	}
	this.alert = function() {
		if(!this.errors.length) return false;

		var msg = '';

		for(var i=0; i<this.errors.length; ++i) {
			msg += '*  ' + this.errors[i];
			if(i < this.errors.length - 1) msg += '\n\n';
		}

		alert(msg);
		return true;
	}
}
function validate_email(email) {
	if(email.length <= 5) return false;
	if(email.indexOf('@', 0) == -1) return false;
	return true;
}
// tellafriend validation
function validate_tellafriend(f) {
	var e = new Errors();

	if(!f.sender_name.value) e.adderror("Sorry, Invalid Name.");
	if(!validate_email(f.sender_email.value)) e.adderror("Sorry, Invalid Email Address!");

	if(!f.recipient_name.value) e.adderror("Sorry, Invalid Friend's Name.");
	if(!validate_email(f.recipient_email.value)) e.adderror("Sorry, Invalid Friend's Email Address!");

	return e.alert() ? false : true;
}
// Show / Hide function
function show(that, k, more, less) {
	var what = document.getElementById('class'+k);

	if(what.style.display == 'none') {
		what.style.display = '';
		that.innerHTML = less;
	}
	else {
		what.style.display = 'none';
		that.innerHTML = more;
	}

}

//slideshow
function rotate() {
	(n == (imgs.length - 1)) ? n = 0 : n++;
	if (document.all) {
		document.images.slideshow.style.filter="blendTrans(duration=2)";
		document.images.slideshow.style.filter="blendTrans(duration=crossFadeDuration)";
		if (document.images['slideshow'].filters) {
			document.images.slideshow.filters.blendTrans.Apply();
		}
	}
	document.slideshow.src = imgs[n];
	timer = setTimeout( "rotate()", timedelay );
	document.slide.caption.value = captions[n];
	if (document.all) document.images.slideshow.filters.blendTrans.Play();
}

function next() {
	if (n == imgs.length-1) {n=0;} else {n=n+1;}
	if (document.all) {
		document.images.slideshow.style.filter="blendTrans(duration=2)";
		document.images.slideshow.style.filter="blendTrans(duration=crossFadeDuration)";
		if (document.images['slideshow'].filters) {
			document.images.slideshow.filters.blendTrans.Apply();
		}
	}
	document.slideshow.src = imgs[n];
	document.slide.caption.value = captions[n];
	if (document.all) document.images.slideshow.filters.blendTrans.Play();
}
function prev() {
	if (n == 0) {n=imgs.length-1;} else {n=n-1;}
	if (document.all) {
		document.images.slideshow.style.filter="blendTrans(duration=2)";
		document.images.slideshow.style.filter="blendTrans(duration=crossFadeDuration)";
		if (document.images['slideshow'].filters) {
			document.images.slideshow.filters.blendTrans.Apply();
		}
	}
	document.slideshow.src = imgs[n];
	document.slide.caption.value = captions[n];
	if (document.all) document.images.slideshow.filters.blendTrans.Play();
}

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
