// JavaScript Document
function w(str){document.write(str);}

/*******************
 *** Asigning image path ***
 ***************************/
var path;
var strurl=location.href
//alert(strurl);
	strurl=strurl.toUpperCase();
var arrurl=strurl.split("/");
var csspath;  //for stylesheet.
var imgpath; //for left buttons images .

//alert(arrurl.length);	

if (strurl.indexOf("SPRYINDIA")!=-1 || arrurl.length==5){
	csspath="../include/"
	imgpath="../images/"
	//imgpath="images/"
	path="../"
	}
else if(strurl.indexOf("SPRYINDIA")!=-1 && arrurl.length==4){
	csspath="include/"
	imgpath="images/"
	path="../";
	}	
else if(arrurl.length==7){
	csspath="../include/";
	imgpath="../images/";
	path="../";
	}
else if(arrurl.length==6 || arrurl.length==9){
	csspath="include/"
	imgpath="images/"
	path="";
	}
//alert(imgpath);
//	csspath="include/"
//	imgpath="images/"

/*Asigning image path*/

w("<link href=\""+csspath+"global.css\" rel=\"stylesheet\" type=\"text/css\">");
w("<script language=javascript src="+csspath+"listboxobject.js></script>")
/*->->->->->->->->->->->->->->->->
Left menu builder*/
var count=0


var mainlinks=new Array;
mainlinks[count++]=["H O M E","index.htm"];
mainlinks[count++]=["About us"];
mainlinks[count++]=["Approach"];
mainlinks[count++]=["Services"];
mainlinks[count++]=["Projects","clients.html"];
mainlinks[count++]=["Partners","partners.html"];
mainlinks[count++]=["Testimonial","testimonial.html"];
mainlinks[count++]=["Employees","employeelogin.html"];
mainlinks[count++]=["Careers"];
mainlinks[count++]=["Gallery","gallery.html"];
//mainlinks[count++]=["Employee Login","../Default.aspx"];

var mainlinksSublinks=new Array();

mainlinksSublinks[0]="";
mainlinksSublinks[1]=new Array();
mainlinksSublinks[1][0]=["Introduction","ABOUT_aboutus.html"];
mainlinksSublinks[1][1]=["Spry Advantages","ABOUT_spryadvantages.html"];
mainlinksSublinks[1][2]=["Team","ABOUT_team.html"];
mainlinksSublinks[1][3]=["Executive Profile","ABOUT_executive.html"];

mainlinksSublinks[2]=new Array;
mainlinksSublinks[2][0]=["Spry Approach","APPROACH-approach.html"];
mainlinksSublinks[2][1]=["Business Intelligence","APPROACH-businessintel.html"];
mainlinksSublinks[2][2]=["Business Systems","APPROACH-businesssystems.html"];
mainlinksSublinks[2][3]=["Integrated Solutions","APPROACH-integratedsolutions.html"];

mainlinksSublinks[3]=new Array();
mainlinksSublinks[3][0]=["Services","SERVICES_services.html"];
mainlinksSublinks[3][1]=["Onsite","SERVICES_onsite.html"];
mainlinksSublinks[3][2]=["Offsite","SERVICES_offsite.html"];
mainlinksSublinks[3][3]=["OffShore","SERVICES_offshore.html"];
//mainlinksSublinks[3][4]=["BPO","SERVICES_bpo.html"];

mainlinksSublinks[4]="";

mainlinksSublinks[5]="";

mainlinksSublinks[6]="";
mainlinksSublinks[7]="";


mainlinksSublinks[8]=new Array();
mainlinksSublinks[8][0]=["Careers","CAREERS_careers.html"];
mainlinksSublinks[8][1]=["Why SPRY","CAREERS_whyspry.html"];
mainlinksSublinks[8][2]=["About SPRY Employee","CAREERS_spryemployees.html"];
mainlinksSublinks[8][3]=["Opportunities","CAREERS_opportunities.html"];

mainlinksSublinks[9]="";
//mainlinksSublinks[9]="";

var visibled="";
function getHeight(divnm){
	var div=document.getElementById(divnm);
	div.style.height="";
	div.style.visibility="hidden"
	var divheight=div.scrollHeight;
	div.style.height=0;
	return divheight;
}

function main(divnm){
//alert(divnm+"---"+visibled)
	if(visibled=="" || visibled==divnm){
		var div=document.getElementById(divnm);
		divvisible=div.style.visibility;
		if(divvisible=="visible"){
		//alert("if")
			up(divnm);
		}
		else{
		document.getElementById("row"+divnm).style.display="";
		down(divnm,getHeight(divnm));
		}
	}	
	else{
	up(visibled,divnm)
	}
}

function down(divnm,divheight){
	var div=document.getElementById(divnm);
	div.style.visibility="visible";
	if(parseInt(div.style.height)<divheight){
		div.style.height=parseInt(div.style.height)+10+"px"
		setTimeout("down('"+divnm+"',"+divheight+")",1);
	}
	visibled=divnm;
}
function up(divnm){
	//alert(up.arguments[0])
	var div=document.getElementById(divnm);

	if(parseInt(div.style.height)>0){
		div.style.height=(parseInt(div.style.height)-10)+"px"
		if(up.arguments[1]!=undefined) {
			setTimeout("up('"+divnm+"','"+up.arguments[1]+"')",1);
		}
		else{
			setTimeout("up('"+divnm+"')",1);
		}
	}
	else{
	document.getElementById("row"+divnm).style.display="none";
	div.style.visibility="hidden"
	}
	visibled="";
	if(up.arguments[1]!=undefined && parseInt(div.style.height)<1){
		//alert(up.arguments[1])
		document.getElementById("row"+up.arguments[0]).style.display="none";
		document.getElementById("row"+up.arguments[1]).style.display="";
		down(up.arguments[1],getHeight(up.arguments[1]));
	}


}
function writeLeftLinks(thispg,text){

if(thispg!=undefined && text!=undefined){
	thispg=thispg.toUpperCase();
	text=text.toUpperCase();
}
else{
thispg="";
text="";
}

//alert(thispg+text)

w("<table border=0 width=100% cellpading=0 cellspacing=0 align=left>");
	for(a=0;a<mainlinksSublinks.length;a++){

		if(mainlinksSublinks[a].length==0){
			w("<tr><td class=leftbuttonbullet>&loz;</td>");
			if(thispg=="M" && mainlinks[a][0].toUpperCase()==text){
				w("<td class=leftbuttonM colspan=2>");
				w(mainlinks[a][0]+"</td></tr>");
			}
			else{
				w("<td class=leftbutton colspan=2 onmouseover=changeBg(this) onmouseout=changeBg(this) onclick=changepage('"+path+mainlinks[a][1]+"')>")
				w("<a href="+path+mainlinks[a][1]+">"+mainlinks[a][0]+"</a></td></tr>");
			}
		}
		else{
		
			w("<tr><td class=leftbuttonbullet width=12>&loz;</td><td onclick=main('links"+a+"') class=leftbutton onmouseover=changeBg(this) onmouseout=changeBg(this)>");
			w(mainlinks[a]+"</td><td class=leftbuttondown onclick=main('links"+a+"')>&nu;</td></tr>");
			w("<tr id=rowlinks"+a+" style='display:none'><td></td><td colspan=2>");
			w("<div id=links"+a+" style=visibility:hidden;overflow:hidden;height:0px>");
			w("<table border=0 width=100% cellpading=0 cellspacing=0>");
			for(x=0;x<mainlinksSublinks[a].length;x++){

				if(thispg=="S" && mainlinksSublinks[a][x][0].toUpperCase()==text){
					w("<tr><td class=leftmenusublinkactive>")						
					w(mainlinksSublinks[a][x][0])				
				}
				else{
				//alert(mainlinksSublinks[a][x][1])
					w("<tr><td class=leftmenusublink onclick=changepage('"+path+mainlinksSublinks[a][x][1]+"') onmouseover=changeBg(this) onmouseout=changeBg(this)>");
					w("<a href="+path+mainlinksSublinks[a][x][1]+">"+mainlinksSublinks[a][x][0]+"</a>");
					}
				w("</td></tr>");
			}
			w("</table></div>");
		}
	}
w("</table>")	
}
/*<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-*/
/*->->->->->->->->->->->->->->->->
Top menu builder*/

var topLinks=new Array();

topLinks[0]=["Contact Us","contactus.html"];
topLinks[1]=["Site Map","sitemap.html"];
topLinks[2]=["Feedback","feedback.html"];

function writeTopMenu(thispg){

	if(thispg!=undefined){
	thispg=thispg.toUpperCase();
	}
	w("<tr><td class=\"topbuttonsbg\">");
	w("<table><tr>");
	for(a=0;a<topLinks.length;a++){
		w("<td>|</td>")
		if(thispg==topLinks[a][0].toUpperCase()){
				w("<td class=topbutton>"+topLinks[a][0]+"</td>")
		}
		else{
				w("<td class=topbutton><a href="+path+topLinks[a][1]+">"+topLinks[a][0]+"</a></td>");
		}

	}
	w("<td>|</td><td><select onchange='change(this)' style=\"font-size:70%; font-family:verdana;width:150px;background-color:#FFCA52;color:#838383;font-family:verdana;font-size:70%; font-weight:bold;\">");
	w("<option selected>Hot links</option>");
	w("<option value="+path+"partners.html>Partners</option>");
	w("<option value="+path+"clients.html>Projects</option>");
	w("<option value="+path+"CAREERS_careers.html>Careers</option>");	
	w("</select></td></tr></table></td></tr>");
	
}
/*<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-*/

function copyright(){
	
	w("<tr><td colspan=\"2\" class=\"bottomstrip\">Copyright � 2009 Spry Resources.  All Rights Reserved.  Legal Notices and Privacy Policy </td></tr>")
	
	}
	
function logo(){	
	
	w("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
       	+"<tr><td height=\"59\" align=\"center\" valign=\"middle\"><img src=\""+imgpath+"logo.gif\"></td></tr>"
		+"<tr><td><img src=\""+imgpath+"women.gif\"></td></tr></table>");
}

function topimage(){
	w("<tr><td background=\""+imgpath+"topbg.gif\"><img src=\""+imgpath+"top.gif\" width=\"609\" height=\"107\"></td></tr>");
	}

var changebg=true;	

function changeBg(obj){
	if(changebg){
		obj.className=obj.className+"M";
		changebg=false;	
	}
	else{
		var c=obj.className;
	var d=c.substr(0,c.length-1);
	//alert(d)
		obj.className=d;
		changebg=true;		
	}
}

function changepage(str){
	//alert(str)
	location.href=str;
}

function pageImage(imgname,text){
	w("<table width=\"80%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"border\">");
	w("<tr><td class=\"image\"><img src=\""+imgpath+imgname+"\" width=187 height=90 border=0></td>");
	w("<td align=\"center\" class=\"imagetext\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"border1\" height=90>");
	w("<tr><td>"+text+"</td></tr>");
	w("</table></td></tr></table>");
}