function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name) {
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1) {
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return "";
}

function aiigshow() {
	aiigshow = getCookie('aiigshow');
	if (aiigshow == null || aiigshow == '') {
		setCookie('aiigshow','true',365);
		aiigshow = getCookie('aiigshow');
	}
	if (!(window.navigator.userAgent.indexOf("Linux") == -1)) {
		setCookie('aiigshow','false','365');
		aiigshow = getCookie('aiigshow');
	}
	if (aiigshow == 'true' && window.XMLHttpRequest) {
		var str = '<div id="filter"></div><div id="aiig2" class="aiig2"><div style="width:1000px;text-align:right;"><a href="javascript:void(0);" onclick="aiighide();" style="text-decoration:none;"><img style="text-decoration:none;" src="aiigclose.png" border="0"></a></div><div id="aiig2vid" class="aiig2vid"></div><div id="aiig2inner" style="width:98%;text-align:center;">'+
		'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000" height="750" id="aiigthrowmov" valign="middle" align="middle"><param name="movie" value="aiigthrow.swf"><param name="AllowScriptAccess" value="always"><param name="play" value="true"><param name="menu" value="false"><param name="quality" value="high"><param name="scale" value="showall"><param name="salign" value="t"><param name="wmode" value="window"><!--[if !IE]>--><object type="application/x-shockwave-flash" data="aiigthrow.swf" width="1000" height="750" align="middle" valign="middle"><param name="play" value="true"><param name="AllowScriptAccess" value="always"><param name="menu" value="false"><param name="quality" value="high"><param name="scale" value="showall"><param name="salign" value="t"><param name="wmode" value="window"></object><!--<![endif]--></object>'+
		'</div></div><div id="aiig1" class="aiig1">'+
		'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="148" height="136" id="aiighandsmov" valign="top" align="right"><param name="movie" value="aiig.swf"><param name="AllowScriptAccess" value="always"><param name="play" value="true"><param name="menu" value="false"><param name="quality" value="high"><param name="scale" value="showall"><param name="salign" value="tr"><param name="wmode" value="transparent"><!--[if !IE]>--><object type="application/x-shockwave-flash" data="aiig.swf" width="148" height="136" align="right" valign="top"><param name="play" value="true"><param name="AllowScriptAccess" value="always"><param name="menu" value="false"><param name="quality" value="high"><param name="scale" value="showall"><param name="salign" value="tr"><param name="wmode" value="transparent"></object><!--<![endif]--></object>'+
		'</div>';
		document.write(str);
	}
}




function aiighide() {
	var aiig2mov = document.getElementById("aiig2");
	aiig2mov.innerHTML='';
	document.getElementById('filter').style.display='none';
}


function aiighidef() {
	setCookie('aiigshow','false','365');
	aiighide();
}


function loadig() {
	document.getElementById('filter').style.display='block';
	var aiig1mov = document.getElementById("aiig1");
	aiig1mov.parentNode.removeChild(aiig1mov);
	aiig1mov.style.display='none';
	var aiig2mov = document.getElementById("aiig2");
	aiig2mov.style.display='block';
}


function aiig_showvid() {
	document.getElementById('aiig2vid').innerHTML = '<object width="332" height="249"><param name="movie" value="http://www.youtube.com/v/-KHvUaTdZhQ&hl=en_US&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-KHvUaTdZhQ&hl=en_US&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="332" height="249"></embed></object>';
}


function loadigdone() {
	var str = '<img src="aiig_eng.jpg" usemap="#aiig" border="0"><map name="aiig"><area shape="rect" coords="320,105,504,142" href="'+
		'http://airsoft-innovations.com/Impact.html'+
		'" target="_blank"><area shape="rect" coords="514,105,698,142" href="'+
		'http://gungas.com/product_info.php?cPath=1&products_id=373'+
		'" target="_blank"><area shape="rect" coords="702,572,890,584" href="'+
		'http://airsoft-innovations.com/'+
		'" target="_blank"><area shape="rect" coords="26,199,470,447" href="javascript:void(0);" onClick="'+
		'aiig_showvid();'+
		'"><area shape="rect" coords="727,56,879,89" href="javascript:void(0);" onClick="'+
		'aiighide();'+
		'"><area shape="rect" coords="727,94,879,128" href="javascript:void(0);" onClick="'+
		'aiighidef();'+
		'">';
	var aiig2mov = document.getElementById("aiig2inner");
	aiig2mov.innerHTML = str;
}

