function IsImageOk(img) {
	if (!img.complete) {
	return false;
	}
	if (typeof img.naturalWidth!= "undefined" && img.naturalWidth== 0) {
	return false;
	}
	return true;
}


function checkloaded()
{
	for (var i = 0; i < document.images.length; i++) {
		if (!IsImageOk(document.images[i])) {
			document.images[i].src=document.images[i].src;
		}
	}
	return true;

}

function showstatictexttabs(divid,id)
{

if(checkloaded()){

document.getElementById('tab1_content_'+id).style.visibility="hidden";
document.getElementById('tab1_content_'+id).style.display="none";
document.getElementById('tab2_content_'+id).style.visibility="hidden";
document.getElementById('tab2_content_'+id).style.display="none";
document.getElementById('tab3_content_'+id).style.visibility="hidden";
document.getElementById('tab3_content_'+id).style.display="none";
document.getElementById('tab4_content_'+id).style.visibility="hidden";
document.getElementById('tab4_content_'+id).style.display="none";
document.getElementById('tab5_content_'+id).style.visibility="hidden";
document.getElementById('tab5_content_'+id).style.display="none";

document.getElementById('tab6_content_'+id).style.visibility="hidden";
document.getElementById('tab6_content_'+id).style.display="none";
document.getElementById('tab7_content_'+id).style.visibility="hidden";
document.getElementById('tab7_content_'+id).style.display="none";
document.getElementById('tab8_content_'+id).style.visibility="hidden";
document.getElementById('tab8_content_'+id).style.display="none";

document.getElementById('spn_tab1_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab2_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab3_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab4_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab5_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab6_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab7_content_'+id).style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab8_content_'+id).style.backgroundColor="#E0E1E2";


document.getElementById(divid).style.visibility="visible";
document.getElementById(divid).style.display="";
document.getElementById("spn_"+divid).style.backgroundColor="#FFFFFF";
}

}



function showarticletabs(divid)
{

if(checkloaded()){

document.getElementById('tab1_content').style.display="none";

document.getElementById('tab2_content').style.display="none";

document.getElementById('tab3_content').style.display="none";

document.getElementById('tab4_content').style.display="none";

document.getElementById('tab5_content').style.display="none";


document.getElementById('tab6_content').style.display="none";

document.getElementById('tab7_content').style.display="none";

document.getElementById('tab8_content').style.display="none";

document.getElementById('spn_tab1_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab2_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab3_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab4_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab5_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab6_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab7_content').style.backgroundColor="#E0E1E2";
document.getElementById('spn_tab8_content').style.backgroundColor="#E0E1E2";



document.getElementById(divid).style.display="";
document.getElementById("spn_"+divid).style.backgroundColor="#FFFFFF";
}

}





function showcategorytabs(divid)
{

if(checkloaded()){
document.getElementById('ctab1_content').style.visibility="hidden";
document.getElementById('ctab1_content').style.display="none";
document.getElementById('ctab2_content').style.visibility="hidden";
document.getElementById('ctab2_content').style.display="none";
document.getElementById('ctab3_content').style.visibility="hidden";
document.getElementById('ctab3_content').style.display="none";
document.getElementById('ctab4_content').style.visibility="hidden";
document.getElementById('ctab4_content').style.display="none";
document.getElementById('ctab5_content').style.visibility="hidden";
document.getElementById('ctab5_content').style.display="none";

document.getElementById('ctab6_content').style.visibility="hidden";
document.getElementById('ctab6_content').style.display="none";
document.getElementById('ctab7_content').style.visibility="hidden";
document.getElementById('ctab7_content').style.display="none";
document.getElementById('ctab8_content').style.visibility="hidden";
document.getElementById('ctab8_content').style.display="none";

document.getElementById('cspn_ctab1_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab2_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab3_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab4_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab5_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab6_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab7_content').style.backgroundColor="#E0E1E2";
document.getElementById('cspn_ctab8_content').style.backgroundColor="#E0E1E2";


document.getElementById(divid).style.visibility="visible";
document.getElementById(divid).style.display="";
document.getElementById("cspn_"+divid).style.backgroundColor="#FFFFFF";
}

}

function showcgtabs(divid)
{

if(checkloaded()){
document.getElementById('cgtab1_content').style.visibility="hidden";
document.getElementById('cgtab1_content').style.display="none";
document.getElementById('cgtab2_content').style.visibility="hidden";
document.getElementById('cgtab2_content').style.display="none";
document.getElementById('cgtab3_content').style.visibility="hidden";
document.getElementById('cgtab3_content').style.display="none";
document.getElementById('cgtab4_content').style.visibility="hidden";
document.getElementById('cgtab4_content').style.display="none";
document.getElementById('cgtab5_content').style.visibility="hidden";
document.getElementById('cgtab5_content').style.display="none";

document.getElementById('cgtab6_content').style.visibility="hidden";
document.getElementById('cgtab6_content').style.display="none";
document.getElementById('cgtab7_content').style.visibility="hidden";
document.getElementById('cgtab7_content').style.display="none";
document.getElementById('cgtab8_content').style.visibility="hidden";
document.getElementById('cgtab8_content').style.display="none";

document.getElementById('cgspn_cgtab1_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab2_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab3_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab4_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab5_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab6_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab7_content').style.backgroundColor="#E0E1E2";
document.getElementById('cgspn_cgtab8_content').style.backgroundColor="#E0E1E2";


document.getElementById(divid).style.visibility="visible";
document.getElementById(divid).style.display="";
document.getElementById("cgspn_"+divid).style.backgroundColor="#FFFFFF";

}
}

function submit_frmsitelang()
{
document.frmsitelang.action="";
document.frmsitelang.submit();
	
}
function showsitesearch()
{


document.getElementById("sitesearchfooter").style.display="";
document.getElementById("sitesearchfooter").style.visibility="visible";
}


function fnSetRequestObject()
{
	var http_request;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
			// See note below about this line
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}

	return http_request;
}
function showrating_post(var12)
{
document.getElementById(var12).style.visibility="visible";
document.getElementById(var12).style.display="";


}

function showhideterms(divid)
{
	if(document.getElementById(divid).style.visibility=="hidden")
	{
	document.getElementById(divid).style.visibility="visible";
	document.getElementById(divid).style.display="";
	}
	else
	{
	document.getElementById(divid).style.visibility="hidden";
	document.getElementById(divid).style.display="none";
	}

}

function selectorderItems(name)
{
	for(i=0;i<document.frmecom1.elements.length;i++)
	{

			if(document.frmecom1.elements[i].type=="checkbox")
			{

				if(document.frmecom1.elements[i].value==name)
				{


					if(document.getElementById(name).value>0)
					{
						document.frmecom1.elements[i].checked=true;
					}
					else
					{
						document.frmecom1.elements[i].checked=false;
					}
				}
			}

	}

}

function addtocart()
{

	if(document.getElementById("showpricing").value>0)
	{

		if(document.getElementById("productcost").value<=0)
		{
				alert("Please click on Calculate Price");
				return;
		}
		else
		{
				document.frmecom1.action="/v1addcarts.php";
				document.frmecom1.submit();
		}
}
else
{
		document.frmecom1.action="/v1addcarts.php";
		document.frmecom1.submit();
}

}

function swapimg(imgIndex, imgTarget) {

	document[imgTarget].src =imgIndex;
}



function showlinks(showlinksval)
{


if(showlinksval=='formimage')
{

document.getElementById("formss").style.visibility="hidden";
document.getElementById("formss").style.display="none";
document.getElementById("formimage").style.visibility="visible";
document.getElementById("formimage").style.display="";

}
else
{
document.getElementById("formimage").style.visibility="hidden";
document.getElementById("formimage").style.display="none";
document.getElementById("formss").style.visibility="visible";
document.getElementById("formss").style.display="";

}

}
//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr','span');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'location=0,resizable=0,menubar=0,width=400,height=400,scrollbars=yes');

}
function createpopup(email_adr,email_subj,email_body,buts,up_under,h,w,full_scr,t,l,pos,freq,freq_days,tbbg_c,tbf_st,tbf_f,tbf_c,tbf_si,cbg_c,cbg_im,bord_c,shad_c,scroll_c,isdrag,isresize,tb_text,content_text,cid,from_file,file_name,tb,lb,db,sbs,mb,sb,slidein,slideFrom,slideout,slideTo,createR,noshadows,autoscroll,nomaxmin,defSend,autoclose,addClickLink,ClickBankUserName,addCodeFromCntDwn,noclose,borderS){
var win;
var wthreec=(document.getElementById)? true: false;
var ie5=(wthreec && document.all)? true : false;
var ns6=(wthreec && (navigator.appName=="Netscape"))? true: false;
var end_top=0;
var end_left=0;
var flag_jo=true;
var str_resize = "yes";
x=l;
y=t;
w=Math.max(w,120);
h=Math.max(h,80);
var wH=document.body.clientHeight;
var wW=document.body.clientWidth;
var tmp_wfr=0;
var tmp_extended_zero = 0;
var s_top=document.all? document.body.scrollTop : window.pageYOffset;shad_w=0;s_top=0;
wW=document.body.clientWidth;wH=screen.height-80; 
tmp_wfr=10;
y=s_top+t;
x=l;
end_top = y-s_top;
end_left = x;
var strTbodyB = /<TBODY>/g;
var strTbodyE = /<\/TBODY>/g;
var strBr = /<br>/g;
content_text = content_text.replace(strTbodyB,"");
content_text = content_text.replace(strTbodyE,"");
content_text = content_text.replace(strBr,"");
var filename = "";
var rem_http = false;
var rem_https = false;
filename = file_name;
tmp_ind = filename.indexOf("http:");
if (tmp_ind>-1) rem_http = true;
tmp_ind = filename.indexOf("https:");
if (tmp_ind>-1) rem_https = true;
tmp_ind = filename.indexOf(":");
if (tmp_ind>-1) {filename = filename.substring((tmp_ind+1),filename.length);}tmp_ind = filename.indexOf("//");
if (tmp_ind>-1) {filename = filename.substring((tmp_ind+2),filename.length);}tmp_ind = filename.indexOf("\\");
if (tmp_ind>-1) {filename = filename.substring((tmp_ind+2),filename.length);}if (rem_http){filename = "http://"+filename;}if (rem_https){filename = "https://"+filename;}var t_b = (tb) ? "yes" : "no";var l_b = (lb) ? "yes" : "no";
var d_b = (db) ? "yes" : "no";
var s_bs = (sbs) ? "yes" : "no";
var m_b = (mb) ? "yes" : "no";
var s_b = (sb) ? "yes" : "no";
str_bg="bgcolor='"+cbg_c+"'";
x_b = x;y_b = y;
win=window.open(filename, cid, "status="+s_b+",menubar="+m_b+",left="+x_b+",top="+y_b+",width="+w+",height="+h+",resizable="+str_resize+",scrollbars="+s_bs+",directories="+d_b+",toolbar="+t_b+",location="+l_b);
}
function OpenForm(frm,h,w){
new createpopup('N/A','Subscribe Me','N/A',false,2,h,w,false,40,200,0,1,0,'DarkBlue','font-weight:bold;','Verdana','White','10pt','White','','DarkBlue','Gray','DarkBlue',true,true,'N/A','','Div1104852891967',true,frm,false,false,false,true,false,false,false,1,false,1,false,false,true,true,true,false,false,'N/A',false,false,1);
}

// Open URL From Category Select List
function openSelectURL()
{ 

// grab index number of the selected option
selInd = document.catForm.cat.selectedIndex; 

// get value of the selected option
goURL = document.catForm.cat.options[selInd].value;

// redirect browser to the grabbed value
top.location.href = goURL; 

}


/* From prototype.js */
document.getElementsByClassName = function(className) {
	var children = document.getElementsByTagName('*') || document.all;
	var elements = new Array();
  
	for (var i = 0; i < children.length; i++) {
		var child = children[i];
		var classNames = child.className.split(' ');
		for (var j = 0; j < classNames.length; j++) {
			if (classNames[j] == className) {
				elements.push(child);
				break;
			}
		}
	}
	return elements;
}

var Reflection = {
	defaultHeight : 0.5,
	defaultOpacity: 0.5,
	
	add: function(image, options) {
		Reflection.remove(image);
		
		doptions = { "height" : Reflection.defaultHeight, "opacity" : Reflection.defaultOpacity }
		if (options) {
			for (var i in doptions) {
				if (!options[i]) {
					options[i] = doptions[i];
				}
			}
		} else {
			options = doptions;
		}
	
		try {
			var d = document.createElement('div');
			var p = image;
			
			var classes = p.className.split(' ');
			var newClasses = '';
			for (j=0;j<classes.length;j++) {
				if (classes[j] != "reflect") {
					if (newClasses) {
						newClasses += ' '
					}
					
					newClasses += classes[j];
				}
			}

			var reflectionHeight = Math.floor(p.height*options['height']);
			var divHeight = Math.floor(p.height*(1+options['height']));
			
			var reflectionWidth = p.width;
			
			if (document.all && !window.opera) {
				/* Copy original image's classes & styles to div */
				d.className = newClasses;
				p.className = 'reflected';
				
				d.style.cssText = p.style.cssText;
				p.style.cssText = 'vertical-align: bottom';
			
				var reflection = document.createElement('img');
				reflection.src = p.src;
				reflection.style.width = reflectionWidth+'px';
				
				reflection.style.marginBottom = "-"+(p.height-reflectionHeight)+'px';
				reflection.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+(options['opacity']*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy='+(options['height']*100)+')';
				
				d.style.width = reflectionWidth+'px';
				d.style.height = divHeight+'px';
				p.parentNode.replaceChild(d, p);
				
				d.appendChild(p);
				d.appendChild(reflection);
			} else {
				var canvas = document.createElement('canvas');
				if (canvas.getContext) {
					/* Copy original image's classes & styles to div */
					d.className = newClasses;
					p.className = 'reflected';
					
					d.style.cssText = p.style.cssText;
					p.style.cssText = 'vertical-align: bottom';
			
					var context = canvas.getContext("2d");
				
					canvas.style.height = reflectionHeight+'px';
					canvas.style.width = reflectionWidth+'px';
					canvas.height = reflectionHeight;
					canvas.width = reflectionWidth;
					
					d.style.width = reflectionWidth+'px';
					d.style.height = divHeight+'px';
					p.parentNode.replaceChild(d, p);
					
					d.appendChild(p);
					d.appendChild(canvas);
					
					context.save();
					
					context.translate(0,image.height-1);
					context.scale(1,-1);
					
					context.drawImage(image, 0, 0, reflectionWidth, image.height);
	
					context.restore();
					
					context.globalCompositeOperation = "destination-out";
					var gradient = context.createLinearGradient(0, 0, 0, reflectionHeight);
					
					gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
					gradient.addColorStop(0, "rgba(255, 255, 255, "+(1-options['opacity'])+")");
		
					context.fillStyle = gradient;
					if (navigator.appVersion.indexOf('WebKit') != -1) {
						context.fill();
					} else {
						context.fillRect(0, 0, reflectionWidth, reflectionHeight*2);
					}
				}
			}
		} catch (e) {
	    }
	},
	
	remove : function(image) {
		if (image.className == "reflected") {
			image.className = image.parentNode.className;
			image.parentNode.parentNode.replaceChild(image, image.parentNode);
		}
	}
}

function addReflections() {
	var rimages = document.getElementsByClassName('reflect');
	for (i=0;i<rimages.length;i++) {
		var rheight = null;
		var ropacity = null;
		
		var classes = rimages[i].className.split(' ');
		for (j=0;j<classes.length;j++) {
			if (classes[j].indexOf("rheight") == 0) {
				var rheight = classes[j].substring(7)/100;
			} else if (classes[j].indexOf("ropacity") == 0) {
				var ropacity = classes[j].substring(8)/100;
			}
		}
		
		Reflection.add(rimages[i], { height: rheight, opacity : ropacity});
	}
}

var previousOnload = window.onload;
window.onload = function () { if(previousOnload) previousOnload(); addReflections(); 

}

















