
	/******** Smooth Popup starts ***********/
function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupContact").fadeIn("slow");
		popupStatus = 1;
	}
}
//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popupStatus = 0;
	}
}
//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});	
}
//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){	
	//LOADING POPUP
	//Click the button event!
	//$("#button").click(function(){
	$(window).ready	(function(){
		//centering with css
		//centerPopup();
		//load popup
		//loadPopup();
	});				
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	});
	
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup();
		}
	});
});

/********** Smooth popup ends  ************/

function setsrc(src)
{

document.getElementById('showpic').src="/showpic/"+src+".cms";
}
function populatediv(urlval,divval){
try{
var xmlhttp=false;
var status=0;
//CHECKING VALUE OF xmlhttp IS TRUE
var str_temp = '<table cellpadding="0" cellspacing="0" width="100%" height="300">';
str_temp = str_temp + '<tr><td valign="middle" align="center"><font face="Arial" size="2" color="#242424">	<b>Loading</b></font>';
str_temp = str_temp + '<img border="0" src="/photo.cms?msid=1748421" hspace="5"></td></tr></table>';
document.getElementById(divval).innerHTML = str_temp;
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
new ActiveXObject("Microsoft.XMLHTTP");
if (xmlhttp){
//checking the state of http object
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4){
if (xmlhttp.status==200)
document.getElementById(divval).innerHTML=xmlhttp.responseText;		
else if (xmlhttp.status==404) status=0
else status=0}}
xmlhttp.open("GET",urlval,true);
xmlhttp.send(null);
show(divval);
}}
catch (e){
xmlhttp = false;}}
function hide(id){
document.getElementById(id).style.display='none';
}
function show(id){
document.getElementById(id).style.display='inline-block';
}

function getObj(id){return document.getElementById(""+id);}
function NBSlider(id,t,w,h){
		this._lockEvt=false;
		this.slideImgNo=1;
		this.cntr = getObj(id);
		this.cntr1wdth=w;
		this.cntr1hght=h;		
		this.curleft=0;
		this.curtop=0;
		this.intrvl=null;
		this.cursld=1;	
		this.totsld=t;
		this.imgn="simg";
		this.lb="lb";
		this.rb="rb";
		this.startSlide=function(d,sobj){		
			if(this._lockEvt){return;}
			if(d=="left"){
				if(this.cursld==this.totsld){return;}
				this.curleft = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))-(this.cntr1wdth*this.slideImgNo);			
				this.cursld++;
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
				if(this.cursld < this.totsld){			
				var simg = getObj(this.imgn+(this.cursld+1));
					if(!(simg.getAttribute("imgpath")=='' || simg.getAttribute("imgpath")==null)){simg.src=simg.getAttribute("imgpath");simg.setAttribute("imgpath","")}
				}
			}else if(d=="right"){
				if(this.cursld==1)return;						
				this.curleft = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))+(this.cntr1wdth*this.slideImgNo);
				this.cursld--;			
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
			}
			else if(d=="up"){
				if(this.cursld==this.totsld){return;}
				this.curtop = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))-(this.cntr1hght*this.slideImgNo);			
				this.cursld++;
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
				if(this.cursld < this.totsld){			
				var simg = getObj(this.imgn+(this.cursld+1));
					if(!(simg.getAttribute("imgpath")=='' || simg.getAttribute("imgpath")==null)){simg.src=simg.getAttribute("imgpath");simg.setAttribute("imgpath","")}
				}
			}else if(d=="down"){
				if(this.cursld==1)return;						
				this.curtop = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))+(this.cntr1hght*this.slideImgNo);
				this.cursld--;			
				this.intrvl=setInterval(sobj+".move('"+d+"')",1);
			}
		};
		this.mngbtn=function(){		
			if(this.cursld==1){getObj(this.lb).className=getObj(this.lb).className+"off";}		
			if(this.cursld==this.totsld){getObj(this.rb).className=getObj(this.rb).className+"off";}
			if(this.cursld > 1 && this.cursld < this.totsld){			
			getObj(this.lb).className=getObj(this.lb).className.replace("off","");
			getObj(this.rb).className=getObj(this.rb).className.replace("off","");}

		};
		this.move=function(d){
			this._lockEvt = true;
			if(d=="left"){
				if(parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))<=this.curleft){
					this.cntr.style.left=this.curleft+"px";
					clearInterval(this.intrvl);this.mngbtn();
					this._lockEvt=false;
				}else{				
					this.cntr.style.left = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))-5+"px";

				}
			}else if(d=="right"){
				if(parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))>=this.curleft){
					this.cntr.style.left=this.curleft+"px";
					clearInterval(this.intrvl);this.mngbtn();				
					this._lockEvt=false;
				}else{
					this.cntr.style.left = parseInt(this.cntr.style.left.substring(0,this.cntr.style.left.length-2))+5+"px";
				}
			}
			else if(d=="up"){
				if(parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))<=this.curtop){
					this.cntr.style.top=this.curtop+"px";
					clearInterval(this.intrvl);this.mngbtn();
					this._lockEvt=false;
				}else{
					this.cntr.style.top = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))-5+"px";
				}
			}else if(d=="down"){
				if(parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))>=this.curtop){
					this.cntr.style.top=this.curtop+"px";
					clearInterval(this.intrvl);this.mngbtn();				
					this._lockEvt=false;
				}else{
					this.cntr.style.top = parseInt(this.cntr.style.top.substring(0,this.cntr.style.top.length-2))+5+"px";
				}
			}	
	
		};
		this.setBtn=function(l,r){this.lb=l;this.rb=r;};	
		
	}


			

	
	function l(xd){vslider.startSlide(xd,'vslider');}


function implementsearch11(){
try{
var searchtext=document.frmsearch1.query.value;
if (searchtext==''){alert('Please insert text to search');document.frmsearch1.query.focus();return false;}
if(x==0){var strsearch = "/searchresult.cms";}
document.frmsearch1.action=strsearch;document.frmsearch1.submit();return false;
}
catch(ex){}
}


function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
				function checkKeyword(){
				
				var trimquery=trim(document.getElementById("query").value);				
				document.getElementById("query").value=trimquery;
				if(trimquery==""){
					alert("Please enter text in search box")
					document.getElementById("query").focus();
					return false

				}}

				var gndr="";
var chrfor="";
var chrfor1="";
function tabtop(obj,divid){
gndr=""
if(chrfor1!=""){
document.getElementById(chrfor1).className='';}
document.getElementById("female").style.fontWeight="normal";
document.getElementById("male").style.fontWeight="normal";
document.getElementById("male").style.color="#ffffff";
document.getElementById("female").style.color="#ffffff";
var iCtr=0;
var divObj=document.getElementById(divid);
if (window.ActiveXObject){	
for(iCtr=0;iCtr<obj.parentNode.children.length;iCtr++){
if(obj.id == obj.parentNode.children.item(iCtr).id)
document.getElementById(obj.parentNode.children.item(iCtr).id).className="current";
else
document.getElementById(obj.parentNode.children.item(iCtr).id).className="";}}
else if (document.implementation && document.implementation.createDocument){
for(iCtr=0;iCtr<obj.parentNode.childNodes.length;iCtr++){ 
if(obj.parentNode.childNodes[iCtr].id!="undefined"){
if(obj.id == obj.parentNode.childNodes[iCtr].id)
obj.parentNode.childNodes[iCtr].className="current";
else
obj.parentNode.childNodes[iCtr].className="";}}}}
function fema(id){

if(id=="male")gndr=1;
else if(id=="female")gndr=2;
else gndr=0;
var t1=document.getElementById('a1');
var t2=document.getElementById('a2');
var t3=document.getElementById('a3');
if (id=='female'){

document.getElementById("male").style.fontWeight="normal";
document.getElementById("male").style.color="#ffffff";
document.getElementById("female").style.color="#FF327F";

if (t1.className=='current'){populatediv("/listall/msid-5292737,gender-"+ gndr +",industry-1,defalfa-"+chrfor+".cms","abcd");}
else if(t2.className=='current'){populatediv("/listall/msid-5292737,gender-"+ gndr +",industry-2,defalfa-"+chrfor+".cms","abcd");}
else if(t3.className=='current'){populatediv("/listall/msid-5292737,gender-"+ gndr +",industry-3,defalfa-"+chrfor+".cms","abcd");}
}if (id=='male'){

document.getElementById("female").style.fontWeight="normal";
document.getElementById("female").style.color="#ffffff";
document.getElementById("male").style.color="#FF327F";
if (t1.className=='current'){populatediv("/listall/msid-5292737,gender-"+ gndr +",industry-1,defalfa-"+chrfor+".cms","abcd");}
else if(t2.className=='current'){populatediv("/listall/msid-5292737,gender-"+ gndr +",industry-2,defalfa-"+chrfor+".cms","abcd");}
else if(t3.className=='current'){populatediv("/listall/msid-5292737,gender-"+ gndr +",industry-3,defalfa-"+chrfor+".cms","abcd");}
}}
function alpha(id,id1){
chrfor = id;
chrfor1 = id1;
var t1=document.getElementById('abcd');


for(var i=1;i<=27;i++){
	var xx = "tablist"+i;	
		if(xx == id1){
		document.getElementById(xx).className='currentlnk';
		}
		else {
		document.getElementById(xx).className='';
		}
	}
	if(chrfor=="ALL")
	{
	populatediv("/listall/5292737.cms","abcd");	
	}
	else
	{
	populatediv("/listall/msid-5292737,defalfa-"+id+".cms","abcd");
	}
}
function populate_wf(urlval,divval,loading,fncname){
	      try{
			var xmlhttp=false;
			var status=0;
			if(loading != 'no'){
				var str_temp = '<table cellpadding="0" cellspacing="0" width="100%" height="100">';
				str_temp = str_temp + '<tr><td valign="middle" align="center" style="font-family:Arial;font-size:13px;font-weight:bold;color:#000000;">Loading';
				str_temp = str_temp + '<img border="0" src="/photo/1748421.cms" hspace="5"></td></tr></table>';
				document.getElementById(divval).innerHTML = str_temp;
			}
			xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");					
			if (xmlhttp){
				xmlhttp.onreadystatechange=function(){
					if (xmlhttp.readyState==4){
						if (xmlhttp.status==200){	
							document.getElementById(divval).innerHTML=xmlhttp.responseText;
							if(fncname != ''){eval(fncname);}
						}
	    				else if (xmlhttp.status==404) status=0
						else status=0
					}
 				}
				xmlhttp.open("GET",urlval,true);
				xmlhttp.send(null);
			}
		}catch (e){
			xmlhttp = false; 
		}	
	}

		 
