function changeCurrency()
{

	SetCookie('user_id', document.CalcCurrency.elements[0].value, expiry);
	
	if (GetCookie('user_id') == null) 
	{
		
    }
    else
    {
    	
    	var getName = GetCookie('user_id');
    	alert('Your have choose ' + getName + ' as your currency!');
    	location.reload(true);
    	ScrollIt();
    	
    }
}

function CurrencyChange(chkdrpId)
{
	SetCookie('user_id', document.getElementById(chkdrpId).value, expiry);
	//alert(chkdrpId);
	
	if (GetCookie('user_id') == null) 
	{
		
    }
    else
    {
    	
    	var getName = GetCookie('user_id');
    	alert('Your have choose ' + getName + ' as your currency!');
    	location.reload(true);
    	ScrollIt();
    	
    }
}


var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1) { endstr = document.cookie.length; }
  return unescape(document.cookie.substring(offset, endstr));
  }


function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) {
      return getCookieVal (j);
      }
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
    }
  return null;
  }

function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
  }

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
  }
  
		//   lixlpixel tooltips     © 2005 http://lixlpixel.com/  //
		////////////////////////////////////////////////////////////
		// position of the tooltip relative to the mouse in pixel //
		var offsetx = 12;
		var offsety =  8;
		
		function newelement(newid)
		{ 
			if(document.createElement)
			{ 
				var el = document.createElement('div'); 
				el.id = newid;     
				with(el.style)
				{ 
					display = 'none';
					position = 'absolute';
				} 
				el.innerHTML = '&nbsp;'; 
				document.body.appendChild(el); 
			} 
		} 
		var ie5 = (document.getElementById && document.all); 
		var ns6 = (document.getElementById && !document.all); 
		var ua = navigator.userAgent.toLowerCase();
		var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
		function getmouseposition(e) // thanks to Grant O. Anderson from Arizona State University
		{
			if(document.getElementById)
			{
				var iebody=(document.compatMode && 
					document.compatMode != 'BackCompat') ? 
						document.documentElement : document.body;
				pagex = (isapple == 1 ? 0 : (ie5)?iebody.scrollLeft:window.pageXOffset);
				pagey = (isapple == 1 ? 0 : (ie5)?iebody.scrollTop:window.pageYOffset);
				mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
				mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

				var lixlpixel_tooltip = document.getElementById('tooltip');
				lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
				lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
			}
		}
		function tooltip(tipdiv)
		{
			var tip = document.getElementById(tipdiv).innerHTML;
			if(!document.getElementById('tooltip')) newelement('tooltip');
			var lixlpixel_tooltip = document.getElementById('tooltip');
			lixlpixel_tooltip.innerHTML = tip;
			lixlpixel_tooltip.style.display = 'block';
			document.onmousemove = getmouseposition;
		}
		function exit()
		{
			document.getElementById('tooltip').style.display = 'none';
		}
		/////////////////////// end tooltips ///////////////////////

function new_window(url) 
{
	link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=236,left=200,top=10");
}
