function mainFn(kIn){
var	today=new Date(); // Initialize Date in raw form
var cr_year = today.getFullYear(); //Getting the current year	
 if(document.getElementById('cp_year'))
    document.getElementById('cp_year').innerHTML = cr_year;
}

var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;
var lvitem          = 0;
var itemId          = 0;

function mopen(id)
{	
    document.getElementById("mnNav11").className = 'mnNavOff';
	document.getElementById("mnNav21").className = 'mnNavOff';
	document.getElementById("mnNav31").className = 'mnNavOff';
	document.getElementById("mnNav41").className = 'mnNavOff';
    lvitem = document.getElementById(id+'1');
	itemId = id;
	mcancelclosetime();
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
	ddmenuitem.style.display = 'block';
}
function mclose(){
       if(ddmenuitem){ 
	      ddmenuitem.style.visibility = 'hidden'; 
		  ddmenuitem.style.display = 'none';
	   }
}
function mclosetime(){closetimer = window.setTimeout(mclose, timeout);}
function mcancelclosetime(){
 	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}


var uNameVl = 'User Name';
var uPassVl = 'Password';

function SrchCln(id){
 	if(document.getElementById(id).value == uNameVl)
	{
		document.getElementById(id).value = '';
	} else if (document.getElementById(id).value == uPassVl){
		document.getElementById('uPass').style.display = 'none';
		document.getElementById('uPassW').style.display = 'block';
		document.getElementById('uPassW').focus();
	}
}
function fcsCln(id){
    if(document.getElementById(id).value == ''){
	 if(id == 'uName'){document.getElementById(id).value = uNameVl}
	 if(id == 'uPass'){document.getElementById(id).value = uPassVl}
	 if(id == 'uPassW'){
		document.getElementById('uPassW').style.display = 'none';
		document.getElementById('uPass').style.display = 'block';
		document.getElementById('uPass').value = uPassVl;
	 }
	}
}

function formChk(){
var uName = document.getElementById("uName");
var uPass = document.getElementById("uPassW");
var uNameVal = uName.value;
var uPassVal = uPass.value;	
	
 if ((uNameVal.length < 3)||(uNameVal==uNameVl)){
    alert("Please enter your \"User Name\"! \nThe entry should not be less than 3 characters.");
    uName.focus();
   } else if ((uPassVal.length < 1)||(uPassVal==uPassVl)){
    alert("Please enter your \"Password\"!");
    document.getElementById("uPass").focus();
  } else {
	 if (document.getElementById("mUname").checked == true){ 
	   uNameVl = document.getElementById("uName").value;
	   //alert('Its true to go ++++:::: '+uNameVl);
	   setCookie('uName',uNameVl,30);
     }
    top.location='lginPg.htm';
  }
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function plnCookie(){
username=getCookie('uName');	
if (username!=null && username!="")
  {
  document.getElementById("uName").value = username;
  }
}



function checkReturn(key) {
  if(key == 13){ 
   formChk();
 }
}

function closeBlk(id){
document.getElementById(id).style.display = 'none'
}
function showBlk(id){
document.getElementById(id).style.display = 'block'
}


function wOpen(pUrl,mdl,h){
  w="700";
  tp=((screen.height/2)-(h/2));
  lt=((screen.width/2)-(w/2));
  chWin = window.open (pUrl+".htm?mdlNum="+mdl, pUrl,"width="+w+",height="+h+",left="+lt+",top="+tp+"");
}

//************************* Carousel + effects **********************//
var thmbNxtCnt = 1;
var thmbPrvCnt = 0;
var i=0;
thmbSlct = new Array
thmbSlct[1] = document.getElementById('stpLnk1')
thmbSlct[2] = document.getElementById('stpLnk2')
thmbSlct[3] = document.getElementById('stpLnk3')
thmbSlct[4] = document.getElementById('stpLnk4')
thmbSlct[5] = document.getElementById('stpLnk5')

stpTtl_txt = new Array
stpTtl_txt[1] = 'Upload Templates'
stpTtl_txt[2] = 'Add Styling'
stpTtl_txt[3] = 'Define Content'
stpTtl_txt[4] = 'Create Modules'
stpTtl_txt[5] = 'Build Sections'



function moveNext(){
thmbNxtCnt = thmbNxtCnt+1;
thmbPrvCnt = thmbPrvCnt+1;
 if (thmbNxtCnt > 5) {
    thmbNxtCnt = 1;
    thmbPrvCnt = 0;
    document.getElementById('stpLnk5').className = 'stpLnkOff_5';
    document.getElementById('stpLnk1').className = 'stpLnkOn_1';
	document.getElementById('stpTtl').innerHTML = stpTtl_txt[1];
	document.getElementById('stpFrm').innerHTML = "<iFrame src=''></iFrame>";
    document.getElementById('stpFrm').innerHTML = "<iFrame id='step1' src='step1.html' width='100%' height='240' frameborder='0' allowtransparency='true' scrolling='no'></iFrame>";
 } else {
	if (thmbNxtCnt == '3') {
	    ifHt = 286;
	} else {
		ifHt = 240;
	}
    
    document.getElementById('stpLnk'+[thmbPrvCnt]).className = 'stpLnkOff_'+thmbPrvCnt;
    document.getElementById('stpLnk'+[thmbNxtCnt]).className = 'stpLnkOn_'+thmbNxtCnt;
	document.getElementById('stpTtl').innerHTML = stpTtl_txt[thmbNxtCnt];
    document.getElementById('stpFrm').innerHTML = "<iFrame src=''></iFrame>";
    document.getElementById('stpFrm').innerHTML = "<iFrame id='step"+thmbNxtCnt+"' src='step"+thmbNxtCnt+".html' width='100%' height='"+ifHt+"' frameborder='0' allowtransparency='true' scrolling='no'></iFrame>";
 }
}


function stepSlct(step,height){
	ifHtDf = typeof(height);
	if (ifHtDf == 'undefined') {
	    height = 0;
	} 
    ifHt = 240 + height;
	
for (i=1;i<thmbSlct.length;i++){
    document.getElementById('stpLnk'+[i]).className ='stpLnkOff_'+i;
    }
	document.getElementById('stpLnk'+step).className = 'stpLnkOn_'+step;
	thmbNxtCnt = step;
	thmbPrvCnt = step -1;
	document.getElementById('stpTtl').innerHTML = stpTtl_txt[thmbNxtCnt];
	document.getElementById('stpFrm').innerHTML = "<iFrame src=''></iFrame>";
    document.getElementById('stpFrm').innerHTML = "<iFrame id='step"+step+"' src='step"+step+".html' width='100%' height='"+ifHt+"' frameborder='0' allowtransparency='true' scrolling='no'></iFrame>";
}


function stepOver(step,height){
	ifHtDf = typeof(height);
	if (ifHtDf == 'undefined') {
	    height = 0;
	} 
    ifHt = 240 + height;
 	for (i=1;i<thmbSlct.length;i++){
    document.getElementById('stpLnk'+[i]).className ='stpLnkOffIn_'+i;
    }
	document.getElementById('stpLnk'+step).className = 'stpLnkOnIn_'+step;
	document.getElementById('stpTtl').innerHTML = stpTtl_txt[step];
	document.getElementById('stpFrm').innerHTML = "<iFrame src=''></iFrame>";
    document.getElementById('stpFrm').innerHTML = "<iFrame id='step"+step+"' src='step"+step+".html' width='100%' height='"+ifHt+"' frameborder='0' allowtransparency='true' scrolling='no'></iFrame>";
	//$("#stpFrm > iframe").slideDown("slow");
}

