	function navigate()
	{
		document.getElementById('button').disabled = false;
		if(white_space(document.getElementById('textfield').value)==''||document.getElementById('textfield').value=='Name')
		{
			alert("Please enter your name");
			document.getElementById('textfield').value=''
			document.getElementById('textfield').focus();
			return false;
		}else{
		var fname = white_space(document.getElementById('textfield').value);
		}
		
		if(white_space(document.getElementById('textfield2').value)==''||document.getElementById('textfield2').value=='Email')
		{
			alert("Please enter email address");
			document.getElementById('textfield2').value=''
			document.getElementById('textfield2').focus();
			return false;
		}else{
			var femail = document.getElementById('textfield2').value;
			if(!validate_email(femail)){
				alert("Please enter a valid email address")
				document.getElementById('textfield2').focus()
				return false;
			}else{		
				femail = white_space(document.getElementById('textfield2').value);
			}
		}
		
		if(white_space(document.getElementById('textfield3').value)==''||document.getElementById('textfield3').value=='Phone No')
		{
			alert("Please enter a valid phone number");
			document.getElementById('textfield3').value=''
			document.getElementById('textfield3').focus();
			return false;
		}else{
		var phno = document.getElementById('textfield3').value;
		if(!validate_phone(phno))
		{
		alert("Please enter a valid phone number");
		document.getElementById('textfield3').focus();
		return false;
		}
		}

		if(white_space(document.getElementById('comments').value)==''||document.getElementById('comments').value=='Message')
		{
			alert("Please enter a brief message");
			document.getElementById('comments').value=''
			document.getElementById('comments').focus();
			return false;
		}else{
		var comments = white_space(document.getElementById('comments').value);
		}
		
		if(document.getElementById('captcha').value==''||document.getElementById('captcha').value=='Enter Code')
		{
			alert("Please enter the code shown");
			document.getElementById('captcha').value=''
			document.getElementById('captcha').focus();
			return false;
		}else{
		var captcha = document.getElementById('captcha').value;
		}				
	//var url = "http://apps.sapplica.com/sapplica_finalup/sapplica_cms/ajax.php?action=ser&name="+fname+"&email="+femail+"&phno="+phno+"&comments="+comments;
	var start = new Date();
	//var url = "http://apps.sapplica.com/sapplica_finalup/sapplica_cms/ajax.php?ts="+start.getTime();
	//var url = "http://sapplica.com/sapplica_test/sapplica_cms/ajax.php?ts="+start.getTime();

	var params = "ts="+start.getTime()+"&action=ser&name="+escape(fname)+"&email="+femail+"&phno="+phno+"&comments="+escape(comments)+"&captcha="+escape(captcha);
	if(window.XMLHttpRequest) {
                req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
        }
		document.getElementById('button2').disabled = "true";
		document.getElementById('button').disabled = "true";
		document.getElementById('loader').style.display="block";
        //req.open("GET", url, true);
		//req.onreadystatechange = statuschangeAccesskey;
        //req.send(null);
		req.open("POST","../ajax.php",true);
		req.onreadystatechange = statuschangeAccesskey;
		req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		req.send(params);
	}
	function white_space(str)
	{
		//field.value = (field.value).replace(/^\s*|\s*$/g,'');
		return str.replace(/^\s*|\s*$/g,'');
	}
	function doCaptcha() {
    url2 = '../captcha/CaptchaSecurityImages.php';
   if(window.XMLHttpRequest) {
                req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
        }
		var data = 'width=100&height=40&characters=5&dummy=' + new Date().getTime();
	req.open("POST", url2, true);
	req.onreadystatechange = returnImageCode;
	req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	req.setRequestHeader("Content-length", data.length);
	req.setRequestHeader("Connection", "close");
	req.send(data);
} 

function returnImageCode() {
	//alert(req.readyState+'%'+req.status);
	if (req.readyState == 4) { // Complete
        if (req.status == 200) { // OK response
		     //code = req.responseText;
			// alert("Test");
			//alert(document.getElementById('imgCaptcha'));
			document.getElementById('imgCaptcha').src = '../captcha/CaptchaSecurityImages.php?' + Math.random();
			} else {
            alert("Problem: " + req.statusText);
        }
	}
}
    
function validate_email(email)
{
	if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}


function validate_phone(phno)
{
	//var phoneRe = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/
    var phoneReg = /^([0-9]){7,15}$/; //General formats for all phone numbers
	var phoneRe = /\d{3}\-\d{3}\-\d{4}/
   var phoneRe2 = /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/; //This will validate all US phone numbers in all formates
	if((phno.search(phoneRe)!=-1) || phno.match(phoneRe2)|| phno.match(phoneReg))
		return true;
	else
		return false;
}

function alertSizew() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function alertSizeh() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}
function statuschangeAccesskey()
{
	if(req.readyState == 4) {
                if(req.status == 200) {
					   response = eval('('+req.responseText+')');
					   if(response.status[0].status.res=='success')
					   {
						   alert(response.status[0].status.message);
						   if(document.getElementById('loader'))
							   document.getElementById('loader').style.display = 'none';
							if(document.getElementById('button2'))
							   document.getElementById('button2').disabled = false;
							if(document.getElementById('button'))
							   document.getElementById('button').disabled = false;
							Clear_fields('ser');
							doCaptcha();
						}
						else if(response.status[0].status.res=='fail')
						{
							alert(response.status[0].status.message);
						   if(document.getElementById('loader'))
							   document.getElementById('loader').style.display = 'none';
							if(document.getElementById('button2'))
							   document.getElementById('button2').disabled = false;
							if(document.getElementById('button'))
							   document.getElementById('button').disabled = false;
						}else if(response.status[0].status.res=='captcha'){
						alert(response.status[0].status.message);
						   if(document.getElementById('loader'))
							   document.getElementById('loader').style.display = 'none';
							if(document.getElementById('button2'))
							   document.getElementById('button2').disabled = false;
							if(document.getElementById('button'))
							   document.getElementById('button').disabled = false;
							doCaptcha();
						}
				}
	}
}

function leftChar(id,value,flag)
		{   

			var maxlength;
			if(flag==1)
			{
				maxlength=30;
			}
			else if(flag==2)
			{
				maxlength=1000;
			}
			else if(flag==3)
			{
				maxlength=1000;
			}
			else if(flag==4)
			{
				maxlength=150;
			}
					var chars=maxlength-parseInt(document.getElementById(id).value.length);	
					 var lable_mess_div=document.getElementById("lable_mess_div");
					 var  lable_mess= document.getElementById("lable_mess");
			if(flag==2)
			{
				if(chars<0)
					{
						alert("Please limit to less than "+maxlength+" characters");
						document.getElementById(id).value=document.getElementById(id).value.substring(0,maxlength);
						document.getElementById('leftchar'+id).innerHTML='<font size="1">'+'0'+'</font>';
						return false;
					}
					else
					{
						document.getElementById('leftchar'+id).innerHTML='<font size="1">'+chars+'</font>';
					}

			}
			else
			{
					if(chars<=0)
					{
						
						alert("Please limit to less than "+maxlength+" characters");
						document.getElementById(id).value=document.getElementById(id).value.substring(0,maxlength);
						document.getElementById('leftchar'+id).value='<font size="1">'+'0'+'</font>';
						return false;
					}
					else
					{
						document.getElementById('leftchar'+id).value='<font size="1">'+chars+'</font>';
					}
			}
		}

function Clear_fields(page){
if(page=='ser')
{
if(document.getElementById('textfield'))
	document.getElementById('textfield').value='Name';
if(document.getElementById('textfield2'))
	document.getElementById('textfield2').value='Email';
if(document.getElementById('textfield3'))
	document.getElementById('textfield3').value='Phone No';
if(document.getElementById('comments'))
	document.getElementById('comments').value='Message';
if(document.getElementById('button'))
	document.getElementById('button').disabled='disabled';
if(document.getElementById('captcha'))
	document.getElementById('captcha').value='Enter Code';
if(document.getElementById('leftcharcomments'))
	document.getElementById('leftcharcomments').innerHTML='<font size="1">1000</font>';
}
}

function checkField_onblur(id,val)
{
		//alert(val)
	var obj = document.getElementById(id);
	
		if(id=='textfield')
			if(obj.value=='Name'||obj.value=='')
				obj.value='Name';
		if(id=='textfield2')
			if(obj.value=='Email'||obj.value=='')
			obj.value='Email';
		if(id=='textfield3')
			if(obj.value=='Phone No'||obj.value=='')
			obj.value='Phone No';
		if(id=='comments')
			if(obj.value=='Message'||obj.value=='')
			obj.value='Message';
		if(id=='captcha')
			if(obj.value=='Enter Code'||obj.value=='')
			obj.value='Enter Code';
	
if(document.getElementById('textfield').value=='Name'&&document.getElementById('textfield2').value=='Email'&&document.getElementById('textfield3').value=='Phone No'&&document.getElementById('comments').value=='Message'&&document.getElementById('captcha').value=='Enter Code')
	{
document.getElementById('button').disabled = 'disabled';
}
else
{
document.getElementById('button').disabled = false;
}
}
function checkField_onfocus(id,val)
{
  document.getElementById(id).select();
}
function checkField_onclick(id,val)
{
		//alert(val)
	var obj = document.getElementById(id);
	
		if(obj.value=='Name')
			obj.value = "";
		if(obj.value=='Email')
			obj.value = "";
		if(obj.value=='Phone No')
			obj.value = "";
		if(obj.value=='Message')
			obj.value = "";
		if(obj.value=='Enter Code')
			obj.value = "";

if(document.getElementById('textfield').value=='Name'&&document.getElementById('textfield2').value=='Email'&&document.getElementById('textfield3').value=='Phone No'&&document.getElementById('comments').value=='Message'&&document.getElementById('captcha').value=='Enter Code')
	{
document.getElementById('button').disabled = 'disabled';
}
else
{
document.getElementById('button').disabled = false;
}
}
function lightWindow(div)
{
switch(div)
	{
case 'terms':
	var html='';
	html+='<table width="500px" height="270px" border="0" cellpadding="3" style="font-size:12px;font-family:Arial;font-weight:normal; border:6px solid #5b5b5b; padding:3px; background:url(http://www.sapplica.com/images/lightwindow_bg.jpg) bottom #feffff repeat-x;  " >';
	html+='<tr><td height="25px" align="left" ><span style="font-size:18px; font-weight:bold; color:#db0b08; border-bottom:1px dashed #db0b08;">Terms and Conditions</span></td><td align="right"><a href="#" onclick=closepopup("terms") style="text-decoration:none;font-size:15px;font-weight:bold;color:#000;position:absolute;left:470px;top:6px;"><img src="http://www.sapplica.com/images/close1.gif" height="22" width="22" border="0" float="left"/></a></td></tr>';

	html+='<tr><td align="left" colspan="2">';
	html+='<div style="overflow-y: scroll; overflow-x: hidden; height: 400px;">'
	html+='<p align="left">';
	html+='Thank you for visiting our website. If you continue to browse and use this website you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern [business name]\'s relationship with you in relation to this website.<br /><br />';

	html+='The term  &quot;Sapplica&quot; or &quot;us&quot; or &quot;we&quot; refers to the owner of the website. The term &quot;you&quot; refers to the user or viewer of our website.<br /><br /> ';

	html+='<a class="anchor_img" style="padding-left:14px;">The content of the pages of this website is for your general information and use only. It is subject to change without notice.</a><br /><br />';
	html+='<a class="anchor_img" style="padding-left:14px;">Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</a><br /><br />';
	html+='<a class="anchor_img" style="padding-left:14px;">Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</a><br /><br />';
	html+='<a class="anchor_img" style="padding-left:14px;">This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</a><br /><br />';
	html+='<a class="anchor_img" style="padding-left:14px;">All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.</a> <br /><br />';
	html+='<a class="anchor_img" style="padding-left:14px;">Unauthorized use of this website may give to a claim for damages and/or be a criminal offence.</a><br /><br />';
	html+='<a class="anchor_img" style="padding-left:14px;">From time to time this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no ';
	html+='responsibility for the content of the linked website(s).<br /><br />';
	html+='You may not create a link to this website from another website or document without Sapplica\'s prior written consent.</a>';
	html+='<br /><br />';
	html+='</p>';
	html+='</div>'
	html+='</td></tr>';
	
	html+='</table>';
	break;
case 'privacy':
	var html='';
	html+='<table width="500px" height="270px" border="0" cellpadding="3" style="font-size:12px;font-family:Arial;font-weight:normal; border:6px solid #5b5b5b; padding:3px; background:url(http://www.sapplica.com/images/lightwindow_bg.jpg) bottom #feffff repeat-x;  " >';
	html+='<tr><td height="25px" align="left" ><span style="font-size:18px; font-weight:bold; color:#db0b08; border-bottom:1px dashed #db0b08;">Privacy Statement</span></td><td align="right"><a href="#" onclick=closepopup("privacy") style="text-decoration:none;font-size:15px;font-weight:bold;color:#000;position:absolute;left:470px;top:6px;"><img src="http://www.sapplica.com/images/close1.gif" height="22" width="22" border="0" float="left"/></a></td></tr>';
	html+='<tr><td align="left" colspan="2">';
	html+='<div style="overflow-y: scroll; overflow-x: hidden; height: 400px;">'
	html+=' <p>';
	html+='Sapplica is committed to protecting your privacy as a visitor to this Website and as our customer.';
	html+='To our visitors and to our customers, we offer this pledge:<br /> <br />';
	html+='Sapplica is the owner of the information, which is collected on this Website. We will not sell, disseminate, disclose, trade, transmit, transfer, share, lease or rent any personally identifiable information to any third party not specifically authorized by you to receive your information.<br /> <br />';
	html+='<strong>Information Collection</strong> <br /> <br />';
	html+='When you send us email from this Website, you will provide us with certain personally identifiable information including your email address.';
	html+='address.  <br /> <br />';
	html+='<strong>Cookies</strong> <br /> <br />';
	html+='A cookie is a piece of data that is stored on a visitor\'s hard drive while they are visiting this Website. We may utilize a short-lived form of cookie when you visit this site. At the Sapplica, a cookie may only used to identify one unique visitor from another visitor during a particular session. A session is the period of active site-use while that unique visitor is linked to our server. We may use cookie technology during a session as a tool to carry forward your input information during the enrollment process. This enables the visitor to input their information once and have the information appear later during the enrollment process. No personally identifiable information is stored on the cookie. The cookie expires and is deleted from the visitor\'s computer as soon as they close their browser.   <br /> <br />';
	html+='<strong>Third Party Links</strong> <br /> <br />';
	html+='This Website may contain links to third party Websites that are not controlled by the Sapplica These third party links are made available to you as a convenience and you agree to use these links at your own risk. Please be aware that the Sapplica is not responsible for the content of third party Websites linked to the Sapplica nor are we responsible for the privacy policy or practices of third party Websites linked to the Sapplica Website. Our Privacy Policy only applies to information we collect from you while you are at and while you are actively in a session with the Sapplica website.  <br /> <br />';
	html+='<strong>Changes In Our Privacy Policy</strong> <br /> <br />';
	html+='We reserve the right to change this Privacy Policy without providing you with advance notice of our intent to make the changes.';
	html+='<br /><br />';
	html+='</p>';
	html+='</div>'
	html+='</td></tr>';
	html+='</table>';
	break;
case 'hiring':
	var html='';
	html+='<table width="500px" height="270px" border="0" cellpadding="3" style="font-size:12px;font-family:Arial;font-weight:normal; border:6px solid #5b5b5b;padding:3px; background:url(http://www.sapplica.com/images/lightwindow_bg.jpg) bottom #feffff repeat-x;  " >';
	html+='<tr><td height="25px" align="left" ><span style="font-size:18px; font-weight:bold; color:#db0b08; border-bottom:1px dashed #db0b08;">Sapplica is Hiring</span></td><td align="right"><a href="#" onclick=closepopup("hiring") style="text-decoration:none;font-size:15px;font-weight:bold;color:#000;position:absolute;left:470px;top:6px;"><img src="http://www.sapplica.com/images/close1.gif" height="22" width="22" border="0" float="left"/></a></td></tr>';
	html+='<tr><td align="left" colspan="2">';
	html+='<div style="overflow-y: scroll; overflow-x: hidden; height: 400px;">'
	html+=' <p align="left">';
	html+='Do you want to be a part of building fun and useful applications in a fast-paced environment? Do you want millions of people to see ';
	html+='and enjoy your work everyday? Are you passionate about building innovative applications with a dynamic team that values your ';
	html+='individual contributions? Then be a part of a company with enormous potential. Email us your resume to <b>careers[at]sapplica[dot]com</b>';
	html+='<br/><br/>';
	html+='<b>Web Designer: (Several Positions)</b>';
	html+='<br/><br/>';
	html+='Sapplica is looking for experienced web designers who has strong conceptual design skills.';
	html+='<br/><br/>';
	html+='<b>Primary responsibilities:</b>';
	html+='<br/><br/>';
	html+='Conceptualize, design and develop social applications<br/><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Create design prototypes, site navigation, and layout of content</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Create visual concepts that match the content and ensure those sites are easy to ';
	html+='navigate</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Build sites using technologies that conform to international standards and make'; 
	html+=' sure that they are universally accessible</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Perform maintenance and updates to existing social applications</a><br/>';
	html+='<br/><br/>';
	html+='<b>Experience and Required Skills:</b>';
	html+='<br/><br/>';
	html+='3-5 years of strong experience in web designing.<br/><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Experience in producing table-less, XHTML, standards-compliant cross browser, and ';
	html+='working with DOM scripting and Movable Type is a big plus. </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Advanced knowledge of XHTML, CSS, JavaScript, DHTML, Flash and of digital imaging, ';
	html+='illustration with Adobe Photoshop, QuarkXPress and Illustrator with formal training an asset.<b> Extensive ';
	html+='experience in developing with ActionScript is a HUGE plus.</b></a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Knowledge and demonstrated experience with cross-browser and cross-platform issues ';
	html+='(IE, Firefox, Safari, etc.) </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Experience working on a Mac platform is a plus. </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Must be self-motivated with excellent interpersonal, communication, presentation,'; 
	html+='and organizational skills. </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Attention to detail, customer-service orientation, and creativity in ';
	html+='problem-solving. </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Ability to work in a team and lead a team of web designers is a big plus.'; 
	html+='</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Superior knowledge of current web-design trends and techniques, a strong online'; 
	html+='portfolio displaying user-centered design, and experience with web database solutions definite assets. </a><br/>';
	html+='<br/><br/>';
	html+='<b>Web/ Application Developer: (Several Positions)</b> <br/><br/>';
	html+='<b>Primary responsibilities:</b>';
	html+='<br/><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Successful candidate will work with team of web/application developers. </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Developing high-availability and high-volume social applications</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Develop, deploy and maintain social applications across the social ';
	html+='networks</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Optimize application performance</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Localization of social applications</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Coordinate feature, user experience and UI review with stakeholders of each ';
	html+='project</a><br/><br/>';
	html+='<b>Experience and Required Skills:</b>';
	html+='<br/><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Must have a minimum working experience of 3 years in web technologies. Candidates '; 
	html+='having more than 4 years of work experience will be considered for Team Lead position.</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Must have good exposure in front-end tier development of web applications using ';
	html+='PHP, AJAX and JavaScript </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Expertise in JavaScript/CSS and familiarity with JS frameworks such as Prototype,'; 
	html+='JQuery etc is a big plus. </a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Experience developing Facebook/Opensocial applications is a HUGE plus</a><br/>';
	html+='<a class="anchor_img" style="padding-left:14px;">Candidates who possess good knowledge of architecture & frameworks will have an ';
	html+='edge over others.</a><br/><br/>';
	html+='If you want to be a part of our dynamic team contact us at<b> careers[at]sapplica[dot]com</b></p>';
	html+='</div>'
	html+='</td></tr>';
	html+='</table>';
	break;
case 'apps':
	var html = '';
	html+='<table width="654px" height="270px" border="0" cellpadding="3" style="font-size:12px;font-family:Arial;font-weight:normal; border:6px solid #5b5b5b;padding:3px; background:url(http://www.sapplica.com/images/lightwindow_bg.jpg) bottom #feffff repeat-x;  " >';
	html+='<tr><td height="22px" align="left" >&nbsp;</td><td align="right"><a href="#" onclick=closepopup("apps") style="text-decoration:none;font-size:15px;font-weight:bold;color:#000;position:absolute;left:660px;top:6px;"><img src="http://www.sapplica.com/images/close1.gif" height="22" width="22" border="0" float="left"/></a></td></tr>';
	html+='<tr><td>';
	//html+='<div style="overflow-y: scroll; overflow-x: hidden; height: 400px; width: 654px">'
	html+='<table width="654px" border="0" cellpadding="0" cellspacing="0" align="center" style="background:url(http://www.sapplica.com/Images/hubtalk_bg.gif) bottom no-repeat; background-color:#FFFFFF; overflow:hidden;">';
	html+='<tr>';
	html+='<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">';
	html+='<tr>';
	html+='  <td width="27%" align="center" valign="middle"><img src="http://www.sapplica.com/Images/Voxboxlogo.gif" alt="VoxBox" width="157" height="56" /></td>';
	html+=' <td width="73%">&nbsp;</td>';
	html+='</tr>';
	html+='</table>';
	html+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	html+='<tr>';
	html+=' <td>&nbsp;</td>';
	html+=' </tr>';
	html+=' </table>';
	html+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	html+='  <tr>';
	html+='   <td width="2%">&nbsp;</td>';
	html+='   <td width="96%"><p style="color:#333333">Simple, yet Powerful. Use Polls and Rated suggestions to gather popular opinions. Community decision making made easy.</p></td>';
	html+='  <td width="2%">&nbsp;</td>';
	html+=' </tr>';
	html+='</table>';
	html+=' <table width="100%" border="0" cellspacing="0" cellpadding="0">';
	html+='   <tr>';
	html+='    <td width="2%">&nbsp;</td>';
	html+='   <td width="61%" align="left"><img src="http://www.sapplica.com/Images/cvoiceicon_1.gif" width="213" height="53" /></td>';
	html+='   <td width="35%" align="left"><img src="http://www.sapplica.com/Images/cvoiceicon_2.gif" width="219" height="56" /></td>';
	html+='   <td width="2%"></td>';
	html+='   </tr>';
	html+=' </table>';
	html+=' <table width="100%" border="0" height="100%" cellspacing="0" cellpadding="0">';
	html+='   <tr>';
	html+='     <td width="2%">&nbsp;</td>';
	html+='     <td width="61%" valign="top"><table width="90%" border="0" cellspacing="0" cellpadding="0">';
	html+='      <tr>';
	html+='        <td width="95%">';
	html+='        <p style="color:#333333">';
	html+='        <a class="anchor_img" style="padding-left:14px;">Create Suggestion Topics and solicit suggestions</a><br />';
	html+='          <a class="anchor_img" style="padding-left:14px;">Allow community members to add suggestions and rate on &nbsp;&nbsp;&nbsp;&nbsp;suggestions</a><br />';
	html+='          <a class="anchor_img" style="padding-left:14px;">Create polls and participate in polls</a><br />';
	html+='       </p>                </td>';
	html+='     </tr>';
	html+='    </table>';
	html+='     <table width="83%" border="0" cellspacing="0" cellpadding="0">';
	html+='        <tr>';
	html+='         <td valign="top"><img src="http://www.sapplica.com/Images/cvoiceicon_3.gif" width="213" height="50" /></td>';
	html+='       </tr>';
	html+='      </table>';
	html+='      <br />';
	html+='       <table width="100%" border="0" cellspacing="0" cellpadding="0">';
	html+='      <tr>';
	html+='        <td width="95%">';
	html+='        <p style="color:#333333">';
	html+='        <a class="anchor_img" style="padding-left:14px;">Inviting friends to participate</a><br />';
	html+='           <a class="anchor_img" style="padding-left:14px;">See Friends\' participation</a><br />';
	html+='           <a class="anchor_img" style="padding-left:14px;">Friend updates on Social Network</a><br />';
	html+='           <a class="anchor_img" style="padding-left:14px;">Community </a><br />';
	html+='           </p>                </td>';
	html+='       </tr>';
	html+='      </table>';
	html+='        <table width="100%" height="50px" border="0" cellspacing="0" cellpadding="0">';
	html+='          <tr>';
	html+='            <td>&nbsp;</td>';
	html+='         </tr>';
	html+='       </table>            </td>';
	html+='     <td width="35%" valign="top">';
	html+='     <p style="color:#333333">';
	html+='     <a class="anchor_img" style="padding-left:14px;">Opensocial&nbsp;API</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">HTML</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">Javascript</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">Ajax</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">PHP</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">MySQL</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">Java Servlets</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">Apache and Tomcat</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">XML</a><br />';
	html+='      <a class="anchor_img" style="padding-left:14px;">Web Services</a><br />';
	html+='       <a class="anchor_img" style="padding-left:14px;">CSS and Sprites</a><br />';
	html+='       </p>          </td>';
	html+='       <td width="2%">&nbsp;</td>';
	html+='     </tr>';
	html+='   </table>      </td>';
	html+=' </tr>';
	html+='<blockquote>&nbsp;</blockquote>';
	//html+='</div>';
	html+='</td></tr></table>';
	break;
case 'contact':
	var html = '';
	html+='<table width="645px" height="270px" border="0" cellpadding="3" style="font-size:12px;font-family:Arial;font-weight:normal; border:6px solid #5b5b5b;padding:3px; background:url(http://www.sapplica.com/images/lightwindow_bg.jpg) bottom #feffff repeat-x;  " >';
	html+='<tr><td height="25px" align="left" ><span style="font-size:18px; font-weight:bold; color:#db0b08; border-bottom:1px dashed #db0b08;">Contact Us Sapplica</span></td><td align="right"><a href="#" onclick=closepopup("contact") style="text-decoration:none;font-size:15px;font-weight:bold;color:#000;position:absolute;left:625px;top:6px;"><img src="http://www.sapplica.com/images/close1.gif" height="22" width="22" border="0" float="left"/></a></td></tr>';
	html+='<tr><td align="left" colspan="2">';
	html+='<table width="645" height="300" border="0" cellspacing="0" cellpadding="0">';
	html+='       <tr>';
	html+='        <td width="390" align="left" valign="top"><img src="http://www.sapplica.com/images/google_map.gif" alt="map" width="390" height="300" /></td>';
	html+='<td width="10" align="left" valign="middle">&nbsp;</td>';
	html+='       <td width="245" align="left" valign="middle" style="background:url(http://www.sapplica.com/images/round_contact.gif) no-repeat center">';
	html+='    <table width="220" height="300" border="0" align="center" cellpadding="2" cellspacing="0">';
	html+='<tr>';
	html+='<td height="20" valign="top"><b style="font-size:14px;">Global Locations</b></td>';
	html+='   </tr>';
	html+=' <tr>';
	html+='   <td height="50" align="left" valign="top" style="border-bottom:1px dashed #d2d2d2;"><span style="border-bottom:1px dotted #4b4b4b;"><b>San Jose, California</b></span><br />';
	html+='     <br />';
	html+='     2880 Zanker Rd, Suite 203<br />';
	html+='      San Jose, CA 95134<br />';
	html+='       United States<br />                        </td>';
	html+=' </tr>';
	html+='  <tr>';
	html+='   <td height="50" align="left" valign="middle" style="border-bottom:1px dashed #d2d2d2;"><span style="border-bottom:1px dotted #4b4b4b;"><strong>Glastonbury, Connecticut<br />';
	html+='    </strong></span><br />';
	html+='    78 Eastern Blvd.<br />';
	html+='      Glastonbury, CT 06033<br />';
	html+='      United States<br />                        </td>';
	html+='  </tr>';
	html+='  <tr>';
	html+='     <td height="50" align="left" valign="bottom" ><span style="border-bottom:1px dotted #4b4b4b;"><strong>India';
	html+='       </strong></span><br />';
	html+='       <br />';
	html+='       Plot# A-32 , 2nd Floor<br />';
	html+='        Road # 5 , Film Nagar, Jubilee Hills<br />';
	html+='        Hyderabad - 500 033<br />';
	html+='        Andhra Pradesh, India<br />                        </td>';
	html+='  </tr>';
	html+='</table></td>';
	html+=' </tr>';
	html+='</table>';
	html+='</td></tr></table>';
	break;
default:
	break;
	}
document.getElementById("GrayOut").style.display="block";
document.getElementById(div).style.display="block";
document.getElementById(div).innerHTML = html;
alignment(div)
}
function alignment(div)
{
        var x,y;
        var test1 = document.body.scrollHeight;
        var test2 = document.body.offsetHeight
        if (test1 > test2) // all but Explorer Mac
        {
			x = document.body.scrollWidth;
			y = document.body.scrollHeight;
		}
        else // Explorer Mac;//would also work in Explorer 6 Strict, Mozilla and Safari
        {
		   if(screen.width == 1024){
				
				x = document.body.scrollWidth;
				y = document.body.scrollHeight;
			}else{
				
				x=screen.width;
			    y=screen.height; 
				x = x-20;y = y-100;
			 }
		   
        }
		document.getElementById('GrayOut').style.width=x+'px';
        document.getElementById('GrayOut').style.height=y+'px';
	
		var a = (x/2)-250;
		var b = (y/2)-135;
		document.getElementById(div).style.width=a+'px';
        document.getElementById(div).style.height=b+'px';

        document.getElementById(div).style.display="block";
 /*       document.getElementById('moreInfo').style.top=Math.ceil(Math.ceil(screen.height/2)/3)+'px';
//       document.getElementById('moreInfo').style.top='500px';
        document.getElementById('moreInfo').style.left=Math.ceil(Math.ceil(screen.width/2)/2)+'px';
 */

		 document.getElementById(div).style.top=Math.ceil(Math.ceil(screen.height/2)/6)+'px';
		 //document.getElementById(div).style.top = '50px';
        document.getElementById(div).style.left=(screen.width-600)/2+'px';
}
function closepopup(id,cas)
{
    document.getElementById('GrayOut').style.display='none';
    document.getElementById(id).style.display='none';
}
function check_length(key)
{
	var maxlength = 50;
	var chars=maxlength-parseInt(document.getElementById('textfield').value.length);
	if(chars<0)
	{
	alert("Please limit to less than "+maxlength+" characters");
	document.getElementById('textfield').value=document.getElementById('textfield').value.substring(0,maxlength);
	document.getElementById('textfield').focus();	
	return false;
	}
}