// html for global header when no flash plugin is detected, it must also be changed in <noscript> in index.php
var noflashheader = '<map name="noflashmap"><area title="News" href="news.php" shape="rect" coords="408, 34, 452, 58"><area title="Features" href="features.php" shape="rect" coords="452, 34, 515, 58"><area title="Download" href="download.php" shape="rect" coords="515, 34, 583, 58"><area title="Help" href="help.php" shape="rect" coords="583, 34, 623, 58"><area title="Community" href="community.php" shape="rect" coords="623, 34, 702, 58"><area title="Promotion" href="promotion.php" shape="rect" coords="702, 34, 777, 58"><area title="Download Flash Player for Free" target="_blank" href="http://www.macromedia.com/go/getflashplayer" shape="rect" coords="380, 0, 772, 20"><area title="Home Page" href="index.php" shape="rect" coords="1, 1, 234, 57"></map><img border="0" src="images/noflash_header.png" width="779" height="59" usemap="#noflashmap">';

// language dropdown
function GFDD_jumpMenu(selObj){ //v3.0
  if(selObj.selectedIndex!=0)
  {
	var sLang = selObj.options[selObj.selectedIndex].value;
	if(sLang == "en")
		window.location.href="features.php";
	else
		window.location.href="global.php?lang="+sLang;
	selObj.selectedIndex=0;
 }
}

function GFDD_findObj(n, d) { //v3.0
  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=GFDD_findObj(n,d.layers[i].document); return x;
}

function GFDD_jumpMenuGo(selName){ //v3.0
  var selObj = GFDD_findObj(selName); if (selObj) GFDD_jumpMenu(selObj);
}

// flash 7 detection
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if(plugin)
{
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < words.length; ++i)
	{
		if (isNaN(parseInt(words[i])))
			continue;
		var GFDD_PluginVersion = words[i]; 
	}
	var GFDD_FlashCanPlay = (GFDD_PluginVersion >= 7);
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1))
{
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n on error resume next \n GFDD_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & 7)))\n</SCR' + 'IPT\> \n');
}

// Image zoom script, used in features section and others

var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (position=="center"){
pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) //compensate for Opera toolbar
vertpos=pgyoffset+window.innerHeight/2-imgheight/2
vertpos=Math.max(pgyoffset, vertpos)
}
else{
var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX - 4
var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY - 4
}
crossobj.style.left=horzpos+"px"
crossobj.style.top=vertpos+"px"

crossobj.innerHTML='<img alt="Loading image, please wait..." title="Click to close the image" src="'+which+'" onClick="closepreview()">'
crossobj.style.visibility="visible"
return false
}
else //if NOT IE 4+ or NS 6+, simply display image in full browser window
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx+"px"
crossobj.style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")

// Image Thumbnail viewer- © Dynamic Drive (www.dynamicdrive.com)
