// JavaScript Document

function showhidelink(id,totVal,tabName,links) {
//alert ("Show ID Value : "+id+"\n Total Number of Div : "+totVal+"\n Tab Var : "+tabName+"\n Tab Status : "+links);
var d = document.getElementById(id);
	for (var i = 1; i<=totVal; i++) {
		if (document.getElementById(tabName+'0'+i)) {
			document.getElementById(tabName+'0'+i).style.display='none';
		}
		if (links=="yes"){
//			alert ("show link");
			document.getElementById(tabName+'0'+i+'link').className='';
//			alert (tabName+'0'+i+'link');
		}
	}
	if (d) {
		d.style.display='block';
		$('#scrollBlock').jScrollPane({animateTo:true, animateInterval:50, animateStep:5, showArrows:true});
		if (links=="yes"){
//			alert (d.id+'link')
			document.getElementById(d.id+'link').className='active';			
		}		
	}
}

/*$(function() {
	$("input[type=file]").filestyle({ 
		image: "../images/browse.gif",
		imageheight : 18,
		imagewidth : 56,
		width : 200
	});
  });
*/

// scripting for top menu starts here
function showtopmenu(id,what) {
var d = document.getElementById(id);
	if (d) {
	if(what!="off"){
			d.style.display='block';
		}else{
			d.style.display='none';
		}
	}
}

//script to close div
function closeMe (id) {
	document.getElementById(id).style.left="-9999px";
}

//script to open div
function openMe (id) {
   
	document.getElementById(id).style.left="0";
}

$(document).ready(function () {
	$('.loginbtn, .chngpass').click(function (e) {
		e.preventDefault();
		$('#basic-modal-content').modal();
	});
});

//script to check box in beauty regime page
function checkMe(id) {
//	alert (document.getElementById(id+"Img").src);
	var imgSrc = document.getElementById(id+"Img").src;
	var imgName = imgSrc.search('off');
//	alert (imgName);
	if (imgName > 0)	{
//		alert ("If condition");
		document.getElementById(id+"Img").src="../images/beauty-regime/checkBox-on.jpg";
		document.getElementById(id+"Input").value = id+"On";
	}
	else {
//		alert ("Else condition");		
		document.getElementById(id+"Img").src="../images/beauty-regime/checkBox-off.jpg";
		document.getElementById(id+"Input").value = "";
	}
}


//script for popups begin here 

function closePopup(thePopup)
 {
     document.getElementById(thePopup).style.display="none";    
        objDiv = document.getElementById("divg");
        objDiv.style.display = "none"; 
        return false;
 }
 function showPopup(thePopup)
 {
    document.getElementById(thePopup).style.display="block";    
         objDiv = document.getElementById("divg");
            objDiv.style.display = "block"; 
            objDiv.style.width = document.body.clientWidth;
            objDiv.style.height= document.body.clientHeight;         
            createPopup(thePopup);        
  }
 function createPopup(oElement)
    {
       var DivWidth = parseInt(document.getElementById(oElement).offsetWidth,10);
       var DivHeight = parseInt(document.getElementById(oElement).offsetHeight,10);
	   var bodyW = document.body.clientWidth;
       var bodyH = document.body.clientHeight;         
       document.getElementById(oElement).style.left = (bodyW / 2) - (DivWidth / 2);
       document.getElementById(oElement).style.top = (bodyH / 2) -  ( DivHeight / 2);
     
       return false;     
    }
	
	
// script for popups ends here	

	function showoverlay (id) {
		document.getElementById(id).style.display="block";
	}
	function closeOverlay(id){
		document.getElementById(id).style.display="none";
	}