
function MM_swapImgRestore() { //v3.0
  //var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.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=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
 // var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   //if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function changecol(a)
{
	
	if (a=="one")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=overview');
	$("#Image27").attr({ src: "images/overview_hover.jpg"});
	$("#Image28").attr({ src: "images/smart_slice.jpg"});
	$("#Image29").attr({ src: "images/smart_graphs.jpg"});
	$("#Image30").attr({ src: "images/smart_boards.jpg"});
	$("#Image31").attr({ src: "images/smart_cast.jpg"});
	}
	
	
	if (a=="two")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartslice-home');
	$("#Image27").attr({ src: "images/overview.jpg"});
	$("#Image28").attr({ src: "images/smart_slice_hover.jpg"});
	$("#Image29").attr({ src: "images/smart_graphs.jpg"});
	$("#Image30").attr({ src: "images/smart_boards.jpg"});
	$("#Image31").attr({ src: "images/smart_cast.jpg"});	
	}
	
	
	if (a=="three")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartgraphs-home');
	$("#Image27").attr({ src: "images/overview.jpg"});
	$("#Image28").attr({ src: "images/smart_slice.jpg"});
	$("#Image29").attr({ src: "images/smart_graphs_hover.jpg"});
	$("#Image30").attr({ src: "images/smart_boards.jpg"});
	$("#Image31").attr({ src: "images/smart_cast.jpg"});	
	}
	
	
	if (a=="four")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartboards-home');
	$("#Image27").attr({ src: "images/overview.jpg"});
	$("#Image28").attr({ src: "images/smart_slice.jpg"});
	$("#Image29").attr({ src: "images/smart_graphs.jpg"});
	$("#Image30").attr({ src: "images/smart_boards_hover.jpg"});
	$("#Image31").attr({ src: "images/smart_cast.jpg"});	
	}
	
	if (a=="five")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartcast-home');
	$("#Image27").attr({ src: "images/overview.jpg"});
	$("#Image28").attr({ src: "images/smart_slice.jpg"});
	$("#Image29").attr({ src: "images/smart_graphs.jpg"});
	$("#Image30").attr({ src: "images/smart_boards.jpg"});
	$("#Image31").attr({ src: "images/smart_cast_hover.jpg"});	
	}
			
	
	
}


$(document).ready(function() {
$('[class^=toggle-item]').hide();
$('[class^=link]').click(function() {
var $this = $(this);
var x = $this.attr("className");
$('[class^=toggle-item]').hide();
$('.toggle-item-' + x).toggle();
return false;
});

$(document).ready(function() {
$('#s_share').hide();
$('#s_free').hide();
$('#s_ana').hide();
$('#s_q123').hide();
$('#s_upload').hide();
});

$('[class^=hlink]').click(function() {
var $this = $(this);
var x = $this.attr("className");
var yy = x.replace(/hlink/, "");
var zz = "#Image"+yy;

for (i=1;i<6;i++)
{
	var zzz = "#Image"+i;
	if (yy==i)
	{
	var img = $(zzz).attr("src");
	img = img.replace(/.jpg/, "_hover.jpg");
	$(zzz).attr({ src: img});
	}
	else
	{
	var img = $(zzz).attr("src");
	var img = $(zzz).attr("src");
	img = img.replace(/_hover.jpg/, ".jpg");
	$(zzz).attr({ src: img});	
	}
}
$('[class^=toggle-item]').hide();
$('.toggle-item-' + x).toggle();
return false;
});

$("#Image1").attr({ src: "images/how_itworks_hover.jpg"});	
$('.toggle-item-hlink1').show();

});

function showhowitworks()
{
$("#Image1").attr({ src: "images/how_itworks_hover.jpg"});	
$('.toggle-item-hlink1').show();
}

function changeproduct(a)
{
	
	if (a=="one")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartslice','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/smart_slice_hover.jpg"});
	$("#Image28").attr({ src: "images/smart_graphs.jpg"});
	$("#Image29").attr({ src: "images/smart_boards.jpg"});
	$("#Image30").attr({ src: "images/smart_cast.jpg"});
	$("#Image31").attr({ src: "images/quick_123.jpg"});
	$("#Image32").attr({ src: "images/sharing.jpg"});	
	}
	
	
	if (a=="two")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartgraphs','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/smart_slice.jpg"});
	$("#Image28").attr({ src: "images/smart_graphs_hover.jpg"});
	$("#Image29").attr({ src: "images/smart_boards.jpg"});
	$("#Image30").attr({ src: "images/smart_cast.jpg"});
	$("#Image31").attr({ src: "images/quick_123.jpg"});
	$("#Image32").attr({ src: "images/sharing.jpg"});	
	}
	
	
	if (a=="three")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartboards','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/smart_slice.jpg"});
	$("#Image28").attr({ src: "images/smart_graphs.jpg"});
	$("#Image29").attr({ src: "images/smart_boards_hover.jpg"});
	$("#Image30").attr({ src: "images/smart_cast.jpg"});
	$("#Image31").attr({ src: "images/quick_123.jpg"});
	$("#Image32").attr({ src: "images/sharing.jpg"});	
	}
	
	
	if (a=="four")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=smartcast','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/smart_slice.jpg"});
	$("#Image28").attr({ src: "images/smart_graphs.jpg"});
	$("#Image29").attr({ src: "images/smart_boards.jpg"});
	$("#Image30").attr({ src: "images/smart_cast_hover.jpg"});
	$("#Image31").attr({ src: "images/quick_123.jpg"});
	$("#Image32").attr({ src: "images/sharing.jpg"});	
	}
	
	if (a=="five")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=quick-1-2-3','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/smart_slice.jpg"});
	$("#Image28").attr({ src: "images/smart_graphs.jpg"});
	$("#Image29").attr({ src: "images/smart_boards.jpg"});
	$("#Image30").attr({ src: "images/smart_cast.jpg"});
	$("#Image31").attr({ src: "images/quick_123_hover.jpg"});
	$("#Image32").attr({ src: "images/sharing.jpg"});	
	}
	
	if (a=="six")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=sharing-delivery-agent','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/smart_slice.jpg"});
	$("#Image28").attr({ src: "images/smart_graphs.jpg"});
	$("#Image29").attr({ src: "images/smart_boards.jpg"});
	$("#Image30").attr({ src: "images/smart_cast.jpg"});
	$("#Image31").attr({ src: "images/quick_123.jpg"});
	$("#Image32").attr({ src: "images/sharing_hover.jpg"});	
	}	
		

	
	
}

function changeforme(a)
{
	
	if (a=="one")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=finance-director','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/financ_director_hover.jpg"});
	$("#Image28").attr({ src: "images/finance_manager.jpg"});
	$("#Image29").attr({ src: "images/managing_director.jpg"});
	$("#Image30").attr({ src: "images/sales_manager.jpg"});
	$("#Image31").attr({ src: "images/report_developer.jpg"});
	$("#Image32").attr({ src: "images/IT_manager.jpg"});	
	}
	
	
	if (a=="two")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=finance-manager','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/financ_director.jpg"});
	$("#Image28").attr({ src: "images/finance_manager_hover.jpg"});
	$("#Image29").attr({ src: "images/managing_director.jpg"});
	$("#Image30").attr({ src: "images/sales_manager.jpg"});
	$("#Image31").attr({ src: "images/report_developer.jpg"});
	$("#Image32").attr({ src: "images/IT_manager.jpg"});	
	}
	
	
	if (a=="three")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=managing-director','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/financ_director.jpg"});
	$("#Image28").attr({ src: "images/finance_manager.jpg"});
	$("#Image29").attr({ src: "images/managing_director_hover.jpg"});
	$("#Image30").attr({ src: "images/sales_manager.jpg"});
	$("#Image31").attr({ src: "images/report_developer.jpg"});
	$("#Image32").attr({ src: "images/IT_manager.jpg"});
	}
	
	
	if (a=="five")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=sales-manager','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/financ_director.jpg"});
	$("#Image28").attr({ src: "images/finance_manager.jpg"});
	$("#Image29").attr({ src: "images/managing_director.jpg"});
	$("#Image30").attr({ src: "images/sales_manager_hover.jpg"});
	$("#Image31").attr({ src: "images/report_developer.jpg"});
	$("#Image32").attr({ src: "images/IT_manager.jpg"});	
	}
	
	if (a=="four")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=report-developer','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/financ_director.jpg"});
	$("#Image28").attr({ src: "images/finance_manager.jpg"});
	$("#Image29").attr({ src: "images/managing_director.jpg"});
	$("#Image30").attr({ src: "images/sales_manager.jpg"});
	$("#Image31").attr({ src: "images/report_developer_hover.jpg"});
	$("#Image32").attr({ src: "images/IT_manager.jpg"});	
	}
	
	if (a=="six")
	{
	$("#headxx").load('gethomepagecontent.php?pagereq=it-manager','',function () {$('a.bumpbox').lightBox();});
	$("#Image27").attr({ src: "images/financ_director.jpg"});
	$("#Image28").attr({ src: "images/finance_manager.jpg"});
	$("#Image29").attr({ src: "images/managing_director.jpg"});
	$("#Image30").attr({ src: "images/sales_manager.jpg"});
	$("#Image31").attr({ src: "images/report_developer.jpg"});
	$("#Image32").attr({ src: "images/IT_manager_hover.jpg"});
	}	
			
	
	
}




function showtips(j)
{
	$("#"+j).toggle();

}


function isValid()
{
	var e=0;
	if(document.forms.loginfrm.username.value == "")  
	{
		e=1;
		alert('This field is mandatory. Please enter your email ID.');		
		document.forms.loginfrm.username.focus();
		return false;
		
	}
	if(document.forms.loginfrm.password.value == "")
	{
		e=1;
		alert('This field is mandatory. Please enter your password.' );
		document.forms.loginfrm.password.focus();
		return false;
	}
		
	if (e==0)
	{
	document.loginfrm.submit();
	return true;
	}

}

function checkEnter(e){ 
var characterCode;
	if(e && e.which){ 
	characterCode = e.which ;
	}
	else{
	characterCode = e.keyCode ;
	}
	
	if(characterCode == 13)
	{ 
	isValid();
	return false;
	}
	else{
	return true;
	}
}

function checkEnter_em(e){ 
var characterCode;
	if(e && e.which){ 
	characterCode = e.which ;
	}
	else{
	characterCode = e.keyCode ;
	}
	
	if(characterCode == 13)
	{ 
	isValid_em();
	return false;
	}
	else{
	return true;
	}
}

function isValid_em()
{
	var e=0;
	if(document.forms.loginfrm.username.value == "")  
	{
		e=1;
		alert('This field is mandatory. Please enter your email ID.');		
		document.forms.loginfrm.username.focus();
		return false;
		
	}
	if (e==0)
	{
	document.forms.loginfrm.password.focus();
	return true;
	}

}
function etrim(stringToTrim) {
	return encodeURIComponent(stringToTrim.replace(/^\s+|\s+$/g,""));
}	

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function create_xml()
{
	var xml = '';
	var f = document.commentForm;
	for (i=0; i<f.elements.length; i++)
	{
		if (f.elements[i].name)
		{
			if (f.elements[i].name=="machineid[]")
			{
				if (f.elements[i].checked)
				{
				xml += f.elements[i].name+"="+etrim(f.elements[i].value)+"&";
				}
			}
			else
			{
			xml += f.elements[i].name+"="+etrim(f.elements[i].value)+"&";
			}
		}
	}
	
	return xml;
}

function validateform()
{
	var email =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
	var eflag = document.forms.commentForm.f_email.value.match(email);
	var cflag = document.forms.commentForm.y_email.value.match(email);
	
	var e=0;
	var str=""
	if(document.forms.commentForm.f_fname.value == "")  
	{
	e=1;
	str = str + 'Please enter First Name.'+"\n";		
	}
	if(document.forms.commentForm.f_lname.value == "")  
	{
	e=1;
	str = str + 'Please enter Last Name.'+"\n";		
	}
	if(eflag!=document.forms.commentForm.f_email.value)  
	{
	e=1;
	str = str + 'Please enter Email.'+"\n";		
	}
	
	if(document.forms.commentForm.y_fname.value == "")  
	{
	e=1;
	str = str + 'Please enter your First Name.'+"\n";		
	}
	if(document.forms.commentForm.y_lname.value == "")  
	{
	e=1;
	str = str + 'Please enter your Last Name.'+"\n";		
	}
	if(cflag!=document.forms.commentForm.y_email.value)  
	{
	e=1;
	str = str + 'Please enter your Email.'+"\n";		
	}	
	if (e==0)
	{
		var xml = create_xml();
		$.ajax({
          type: 'post',
          url: 'sendemail.php',
		  data: xml+'&submit=submit',      
          success: function(results) 
		  {	
		   $('#commentForm').html(results);
          }
		}); // end ajax 
	}
	else
	{
	alert(str);
	}
}


function frmcheck()
{
	var email =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
	var eflag = document.forms.frmcontact.email.value.match(email);
		
	var e=0;
	var str=""
	if(document.forms.frmcontact.fullname.value == "")  
	{
	e=1;
	str = str + 'Please enter Full Name.'+"\n";		
	}
	if(document.forms.frmcontact.country.value == "selected")  
	{
	e=1;
	str = str + 'Please select Country.'+"\n";		
	}
	if(eflag!=document.forms.frmcontact.email.value)  
	{
	e=1;
	str = str + 'Please enter Email.'+"\n";		
	}
	if(document.forms.frmcontact.tel.value == "" || document.forms.frmcontact.tel.value.length  < 5)  
	{
	e=1;
	str = str + 'Please enter Telephone Number.'+"\n";		
	}
	else
	{
		if(!IsNumeric(document.forms.frmcontact.tel.value))  
		{
		e=1;
		str = str + 'Please enter Telephone Number.'+"\n";		
		}
	}	
	if(document.forms.frmcontact.capcode.value == "")  
	{
	e=1;
	str = str + 'Please enter Security Characters.'+"\n";		
	}	
	if (e==0)
	{
		document.forms.frmcontact.submit();
	}
	else
	{
	alert(str);
	return false;
	}
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.+- ";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
	Char = sText.charAt(i); 
	if (ValidChars.indexOf(Char) == -1) 
	{
	IsNumber = false;
	}
   }
   return IsNumber;
}