jQuery.noConflict();
/* Other scripts from hover, etc. */
/*----------------------------------------------+
 | AJAX - Creates AJAX Request Object |
 +----------------------------------------------*/
function makeHttpRequestObj() {
	
	var reqObj = null;
	if (window.XMLHttpRequest) {
		reqObj = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		reqObj = new ActiveXObject("Msxml2.XMLHTTP");
		if (!reqObj) {
			reqObj = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if (reqObj) {
		return reqObj;
	} else {
		return null;
	}
}

// From jslib.js
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];}
}
function showFlash(url, w, h) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie"  value="'+url+'">');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="'+url+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" AllowScriptAccess="always" width="'+w+'" height="'+h+'"></embed>');
	document.write('</object>');
}

/*
 * 
 * End Other scripts from hover, etc.
 *
 */

/* All the stuff from scripts originally */

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];}
}
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 openNewWindow(URLtoOpen, windowName, windowFeatures) {
	newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
}

function aninputFocusBind() {
	jQuery(".aninput").focus(function() {
		if(jQuery(this).attr('id')=='PasswordText') {
			jQuery(this).parent().html("<input type=\"password\" id=\"Password\" name=\"password\" title=\"Password\" class=\"aninput\" />");
			document.getElementById("Password").focus();
			aninputBlurBind();
		} else if(jQuery(this).attr('id')=='PasswordText1') {
			jQuery(this).parent().html("<input type=\"password\" id=\"Password1\" name=\"password1\" title=\"Password\" class=\"aninput\" />");
			document.getElementById("Password1").focus();
			aninputBlurBind();
		} else if(jQuery(this).attr('id')=='PasswordText2') {
			jQuery(this).parent().html("<input type=\"password\" id=\"Password2\" name=\"password2\" title=\"Password\" class=\"aninput\" />");
			document.getElementById("Password2").focus();
			aninputBlurBind();
		} else if(jQuery(this).attr('value')==jQuery(this).attr('id').replace(/_/g, ' ').replace(/[0-9]/, '')) {
			jQuery(this).attr('value', "");
		}
	});
}

function aninputBlurBind() {
	jQuery(".aninput").blur(function () {
		if(jQuery(this).attr('value')=='')
		{
			if(jQuery(this).attr('id')=='Password' && jQuery(this).attr('value')=='') {
				jQuery(this).parent().html("<input type=\"text\" id=\"PasswordText\" name=\"password-text\" title=\"Password\" class=\"aninput\" value=\"Password\" />");
				aninputFocusBind();
			} else if(jQuery(this).attr('id')=='Password1' && jQuery(this).attr('value')=='') {
				jQuery(this).parent().html("<input type=\"text\" id=\"PasswordText1\" name=\"password-text1\" title=\"Password\" value=\"Create Password\" class=\"aninput\" />");
				aninputFocusBind();
			} else if(jQuery(this).attr('id')=='Password2' && jQuery(this).attr('value')=='') {
				jQuery(this).parent().html("<input type=\"text\" id=\"PasswordText2\" name=\"password-text2\" title=\"Password\" value=\"Confirm Password\" class=\"aninput\" />");
				aninputFocusBind();
			} else {
				jQuery(this).attr('value', jQuery(this).attr('id').replace(/_/g, ' ').replace(/[0-9]/, ''));
				document.getElementById(jQuery(this).attr('id')).type = 'text';
			}
		}
	});
}

function urlencode(str) {
	str = escape(str);
	str = str.replace('+', '%2B');
	str = str.replace('%20', '+');
	str = str.replace('*', '%2A');
	str = str.replace('/', '%2F');
	str = str.replace('@', '%40');
	return str;
}

function timeToHuman()
{
	var theDate = new Date(document.u2h.timeStamp.value * 1000);
	dateString = theDate.toGMTString();
	document.u2h.result.value = dateString;
}

function humanToTime()
{
	var humDate = new Date(Date.UTC(document.h2u.inYear.value,
		(stripLeadingZeroes(document.h2u.inMon.value)-1),
		stripLeadingZeroes(document.h2u.inDay.value),
		stripLeadingZeroes(document.h2u.inHr.value),
		stripLeadingZeroes(document.h2u.inMin.value),
		stripLeadingZeroes(document.h2u.inSec.value)));
		document.h2u.result.value = (humDate.getTime()/1000.0);
}

function stripLeadingZeroes(input)
{
	if((input.length > 1) && (input.substr(0,1) == "0"))
		return input.substr(1);
	else
		return input;
}

jQuery('#nav').ready(function() {
	if(jQuery('#nav').attr('id')) {
		new Hover(jQuery("#nav"));
	}
});

jQuery(document).ready(function() {
	if(jQuery('ul#point-main').attr('id')) {
		jQuery('ul#point-main').innerfade({
			speed: 1500,
			timeout: 20000,
			type: 'sequence',
			containerheight: '280px'
		});
	}

	jQuery('.afeaturetitle').children('a').attr('href', 'javascript:void(0);')
	jQuery('.afeaturetitle').children('a').click(function() {
		clearTimeout(jQuery.innerfade.ifchanger);
		for(i=1;i<5;i++) {
			jQuery('#the'+i+'feature').css("display", "none");
			// jQuery('#the'+i+'title').children('a').css("font-family", "Helvetica, Arial, sans-serif");
			jQuery('#the'+i+'title').children('a').css("font-size","11px");
			jQuery('#the'+i+'title').children('a').css({"width":"100px" });
			jQuery('#the'+i+'title').children('a').css("color","#2575AD");
			jQuery('#the'+i+'title').children('a').css("text-decoration","none");
			jQuery('#the'+i+'title').children('a').css("background-color","#ffffff");
		}
		if(the_widths[(jQuery(this).attr('rel')-1)]==960) {
			jQuery("#vic").hide();
		} else {
			jQuery("#vic").show();
		}
		
		jQuery('#the'+(jQuery(this).attr('rel'))+'feature').css("display", "block");
		
		var a_top_space = ((jQuery(this).attr('rel')-1)*70) + 00;
		jQuery("#the_arrow").animate({ top:a_top_space.toString()+"px" }, 300);
		jQuery(this).animate({ "top":"70px" }, 300);
		jQuery(this).css("color","#fff");
	
		jQuery(this).css("background-color","#ffffff");
        // jQuery(this).css("font-family", 'Georgia, "Times New Roman", serif');
		jQuery(this).css("font-size","16px");
	    clearTimeout(jQuery.innerfade.ifchanger);
	});
}); 
