var myImages = new Array ("images/ajax-loader.gif","images/whoweare_over.gif", "images/whatwedo_over.gif","images/whatwethink_over.gif","images/howwedo_over.gif","images/content_bg.jpg");
 
var myPreload = new Array ();
 
for (var i = 0; i < myImages.length; i++ )
{
 
myPreload[ i ]= new Image();
myPreload[ i ].src = myImages[ i ];
 
}

/*Example message arrays for the two demo scrollers*/

/*var pausecontent=new Array()

pausecontent[0]='<span class="date">Thursday, August 5, 2010</span><br><a href="#" class="nhead">INTERARCH Building Products (P) Limited bags Essar Steel Infrastructure Excellence Award - 2010</a>'
pausecontent[1]='Digital Law & Kenneth launches an experiential 3G corporate site for HCC, www.hccindia.com'
pausecontent[2]="Lavasa, Free India's first and largest township, gets a brand new online address at www.lavasa.com"
pausecontent[3]="India's fastest growing sport gets a brand new web profile. Check out www.forceindiaf1.com"
pausecontent[4]='Digital Law & Kenneth bags marketing microsites for Bombay Dyeing and ITC'
pausecontent[5]='Digital Law & Kenneth powers e-commerce for Indian Terrain, a leading retail offering'
pausecontent[6]='Digital Law & Kenneth bags the prestigious online mandate for HCC and Lavasa'
pausecontent[7]='Digital Law & Kenneth prelaunches the Skoda Fabia online, a first in the automobile segment'
pausecontent[8]='Digital Law & Kenneth launches proprietary "AIMS" model for online accountability'
pausecontent[9]='Anchor Corporate Digital business awarded to Digital Law & Kenneth'
pausecontent[10]='B2B & B2C Digital assets planned and in the pipeline'
pausecontent[11]='Digital Law & Kenneth assisting Brics Securities in conceptualizing and launching a Web 2.0 financial portal'*/


var seconds = 0;
var hours = 0;
var minutes = 0 ;
var msgcount =0;


function display_data()
{
  seconds+=1;
	if(hours==0 && minutes == 2 && msgcount==0)
	{
		animate();
		msgcount =1;
	}
    
	if (seconds >= 60)
	{
		 seconds=0;
		 minutes+=1;
		
		if(minutes >= 60){
			minutes=0;
			hours+=1;
		 }
     }
	var timeValue = "" + hours;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds
	document.getElementById('timer').innerHTML = timeValue;
			
	 setTimeout("display_data()",1000);
  }




/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}


/////////////////////////////

function timedMsg()
{
	var t=setTimeout("settimebookmark();",2000);
}

function settimebookmark()
{  
	addthis_pub             = 'sgaykhe'; 
	addthis_logo            = 'http://www.addthis.com/images/yourlogo.png';
	addthis_logo_background = 'EFEFFF';
	addthis_logo_color      = '666699';
	addthis_brand           = 'lkdigi.com';
	addthis_options         = 'favorites, email, digg, delicious, google, more';
	document.getElementById('div1').style.display='block';
}




///////////////////////////////

var clickedid=0;
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function imgChange(id){
	resetImages();
	clickedid=id;
	if(id==1){
		document.getElementById("Image23").src="images/whoweare_over.gif";
		document.getElementById("home_img").src="images/who_we_are_top_left.jpg";
	}
	if(id==2){
		document.getElementById("Image24").src="images/whatwedo_over.gif";
		document.getElementById("home_img").src="images/what_we_do_left_top.jpg";
	}
	if(id==3){
		document.getElementById("Image25").src="images/howwedo_over.gif";
		document.getElementById("home_img").src="images/howwedo_top_left.jpg";
	}
	if(id==4){
		document.getElementById("Image26").src="images/whatwethink_over.gif";
		document.getElementById("home_img").src="images/whatwethink_top_left.jpg";
	}
	if(id==5){
		document.getElementById("Image111").src="images/menu_top_over_01.png";
		document.getElementById("home_img").src="images/home.jpg";
		document.getElementById("share").style.visibility="visible";
	}
	if(id==17){
		document.getElementById("Image222").src="images/menu_top_over_02.png";
		document.getElementById("home_img").src="images/contactus_top.jpg";
	}
	if(id==18){
		document.getElementById("Image333").src="images/menu_top_over_03.jpg";
		document.getElementById("home_img").src="images/sitemap_top.jpg";
	}
	
	
}

function resetImages(){
	clickedid=0;
	document.getElementById("Image23").src="images/whoweare.gif";
	document.getElementById("Image24").src="images/whatwedo.gif";
	document.getElementById("Image25").src="images/howwedo.gif";
	document.getElementById("Image26").src="images/whatwethink.gif";
	document.getElementById("home_img").src="images/home.jpg";
	document.getElementById("Image111").src="images/menu_top_01.png"
	document.getElementById("Image222").src="images/menu_top_02.png"
	document.getElementById("Image333").src="images/menu_top_03.jpg"
	document.getElementById("share").style.visibility="hidden";
	
	//document.getElementById("Image222").src="images/menu_top_02.png"
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
 	if(clickedid==1){
		document.getElementById("Image23").src="images/whoweare_over.gif";
	}
	if(clickedid==2){
		document.getElementById("Image24").src="images/whatwedo_over.gif";
	}
	if(clickedid==3){
		document.getElementById("Image25").src="images/howwedo_over.gif";
	}
	if(clickedid==4){
		document.getElementById("Image26").src="images/whatwethink_over.gif";
	}		
	if(clickedid==5){
		document.getElementById("Image111").src="images/menu_top_over_01.png";
	}		
		if(clickedid==17){
		document.getElementById("Image222").src="images/menu_top_over_02.png";
	}	
	if(clickedid==18){
		document.getElementById("Image333").src="images/menu_top_over_03.jpg";
	}	
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



/////////////////////////
var prev_html;
var prev_html1;

function calValid()
{
	if(document.newsletter.txtEmailNews.value == "")
	{
		alert("Please enter your Email-ID")
		return false
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

	if(reg.test(document.newsletter.txtEmailNews.value) == false)
	 {
		alert("Invalid Email-ID")
		return false;
		
	 }	
	
	req = createXMLHttpRequest();
	setobj = document.getElementById("news_lett"); 
	sendRequest("newsletter.php?txtEmailNews="+ document.newsletter.txtEmailNews.value);
	prev_html = document.getElementById("news_lett").innerHTML;
	showdiv(document.getElementById("news_lett"));
}


function sendMail(){
	
	var objName = document.getElementById("txtName");
	document.getElementById("errName").style.display="none";
	
	if(objName.value==""){
		document.getElementById("errName").style.display="inline";
		objName.focus();
		return false;
	}
	
	
	var objCompName = document.getElementById("txtCompanyName");
	document.getElementById("errCompName").style.display="none";
	
	if(objCompName.value==""){
		document.getElementById("errCompName").style.display="inline";
		objCompName.focus();
		return false;
	}
	
	var objEmail = document.getElementById("txtEmail");
	document.getElementById("errBlankEmail").style.display="none";
	
	
	if(objEmail.value==""){
		document.getElementById("errInvalidEmail").style.display="none";
		document.getElementById("errBlankEmail").style.display="inline";
		objEmail.focus();
		return false;
	}
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	document.getElementById("errInvalidEmail").style.display="none";		
	if(reg.test(objEmail.value) == false)
	 {
		document.getElementById("errInvalidEmail").style.display="inline";
		objEmail.focus();
		return false;
		
	 }	
	
	var objDesc = document.getElementById("txtEnquiry");
	document.getElementById("errDesc").style.display="none";
	
	
	if(objDesc.value==""){
		document.getElementById("errDesc").style.display="inline";
		objDesc.focus();
		return false;
	}
	var objOpt = document.enquiryForm.optPurpose[document.enquiryForm.optPurpose.selectedIndex].value;
	req = createXMLHttpRequest();
	setobj = document.getElementById("form_box"); 
	sendRequest("sendmail.php?txtName="+ objName.value + "&txtCompanyName=" + objCompName.value + "&txtEmail=" + objEmail.value +"&txtEnquiry=" + objDesc.value +"&optPurpose=" + objOpt);
	prev_html1 = document.getElementById("form_box").innerHTML;
	showdiv(document.getElementById("form_box"));

//document.enquiryForm.submit();
}

req = createXMLHttpRequest();
var binary;
var filename;
var mytext;

function chkcareers()
{	
	document.getElementById("errName").innerHTML ="";
	var objName = document.getElementById("txtName");
	document.getElementById("errName").style.display="none";
	
	if(objName.value==""){
		document.getElementById("errName").innerHTML = "<font color='red'>Enter your name</font>";
		document.getElementById("errName").style.display="inline";
		objName.focus();
		return false;
	}

	var objName1 = document.getElementById("txtName2");
	
	if(objName1.value==""){
		document.getElementById("errName").innerHTML = "<font color='red'>Enter your Email-Id</font>";
		document.getElementById("errName").style.display="inline";
		objName1.focus();
		return false;
	}

	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if(reg.test(objName1.value) == false)
	 {
		document.getElementById("errName").innerHTML = "<font color='red'>Invalid Email-Id</font>";
		document.getElementById("errName").style.display="inline";
		objName1.focus();
		return false;
		
	 }	
	
	var objName2 = document.getElementById("txtCompanyName");
	
	if(objName2.value==""){
		document.getElementById("errName").innerHTML = "<font color='red'>Enter your contact number</font>";
		document.getElementById("errName").style.display="inline";
		objName2.focus();
		return false;
	}


	if(isNaN(objName2.value))
	{
		objName2.value="";
		document.getElementById("errName").innerHTML = "<font color='red'>Enter your contact number in numeric format</font>";
		document.getElementById("errName").style.display="inline";
		objName2.focus();
		return false;
	}
	
	var objName3 = document.getElementById("txtCompanyName2");
	
	if(objName3.value==""){
		document.getElementById("errName").innerHTML = "<font color='red'>Upload your resume</font>";
		document.getElementById("errName").style.display="inline";
		objName3.focus();
		return false;
	}



	var image_1 = new Image();
	image_1.src = document.enquiryForm.txtCompanyName2.value;
	//alert(image_1.src);
	
    var fileName = document.enquiryForm.txtCompanyName2.value;	
	var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
    if(ext == "doc" || ext == "DOC" || ext == "pdf" || ext == "PDF" || ext == "txt" || ext == "TXT" || ext == "rtf" || ext == "RTF")
    {

		/*setobj = document.getElementById("form_box"); 
		var str_pass = "txtName="+objName.value+"&txtName2="+objName1.value+"&txtCompanyName="+objName2.value+"&txtCompanyName2="+objName3.value;
		
		sendRequest_POST('uploadresume.php',str_pass);
		prev_html1 = document.getElementById("form_box").innerHTML;		
		showdiv(document.getElementById("form_box"));	*/
		
		//document.resumefrm.action = "../uploadresume.php";
		//document.resumefrm.submit();
		return true;
    }         
    else
    {
		document.getElementById("errName").innerHTML = "<font color='red'>Upload doc or txt or pdf file only</font>";
		document.getElementById("errName").style.display="inline";
		objName3.focus();
		return false;

		//alert("Upload doc or txt file only");
		//document.resumefrm.resume.focus();
		//return false;
	}

}



///////////////////////////////Timer messge ////////////////////////
/*
Typing Scroller
Submitted by bengaliboy00@hotmail.com (hp: http://www.angelfire.com/nt/bengaliboy/)
With modifications by Dynamicdrive.com
For full source code, usage terms, and 100s more scripts, visit http://dynamicdrive.com
*/

//Secify scroller contents
/*var line=new Array()
line[1]="You've been here for 2 minutes. Like looking around, huh?"
line[2]="Well, we\'re honoured that you'd spend time here instead of on Facebook."
line[3]="Did you know that there is a train every three minutes on the Western Railway in Mumbai?"
line[4]="The average length of a YouTube video is 2:37 minutes. You've officially bypassed that!"
line[5]="There are 31,557,600 seconds in a year. And you just spent 240 of those on our site!"

line[6]="Everything is so nice and colourful here! Wouldn't you like to stay here forever?";
line[7]="Living inside a website… wouldn't that be something?";
line[8]="Who knows, maybe we'll be able to do that someday.";
line[9]="We would never leave.";
line[10]="Did you know that lightning strikes 100 times every second? So that's 3900 lightning bolts for the time you've spent here!";
line[11]="You\'ve now been here for 7 minutes! Did you know that Safari's browser market share is almost 7%?";
line[12]="Today is the first day of the rest of your life. Think about it.";
line[13]="If the sun stopped shining suddenly, it would take eight minutes for people on earth to be aware of the fact.";
line[14]="We\'re starting to think you're a little bit addicted now.";
line[15]="You have our attention. We'd really like to know who you are.";
line[16]="So write to us, already!";


//Specify font size for scoller
var ts_fontsize="16px"

//--Don't edit below this line

var longestmessage=1
for (i=2;i<line.length;i++){
if (line[i].length>line[longestmessage].length)
longestmessage=i
}

//Auto set scroller width
var tscroller_width=line[longestmessage].length

lines=line.length-1 //--Number of lines

temp=""
nextchar=-1;
nextline=1;
cursor="\\"
msgflag=0;

function animate()
{
	

	if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines)
	{
		nextline++;
		nextchar=-1;
		document.bannerform.banner.value=temp;
		temp="";
		
			
		setTimeout("nextstep()",28000)
		setTimeout("hidedivmsg()",5000)	
		
	}
	else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length)
	{
	//	nextline=1;
	//	nextchar=-1;
	//	document.bannerform.banner.value=temp;
	//	temp="";
	//	setTimeout("nextstep()",4000)
		setTimeout("hidedivmsg()",5000)		
	}
	else{

		nextstep()

	}

}

function hidedivmsg()
{
	//document.getElementById("msguser").style.display="none";
	 $("#msguser").hide();
}

function nextstep()
{
	$("#msguser").fadeIn("slow");
   // $("#msguser").slideDown("slow");


	//document.getElementById("msguser").style.display="inline";


	if (cursor=="\\"){
	cursor="|"}
	else if (cursor=="|"){
	cursor="/"}
	else if (cursor=="/"){
	cursor="-"}
	else if (cursor=="-"){
	cursor="\\"}


	nextchar++;
	temp+=line[nextline].charAt(nextchar);
	document.bannerform.banner.value=temp+cursor
	setTimeout("animate()",25)
	
}
/////////////////////////////////////////////////////////////////////
*/

var line=new Array()
line[1]=" You've been here for 2 minutes. Like looking around, huh?"
line[2]=" Well, we\'re honoured that you'd spend time here instead of on Facebook."
line[3]=" Did you know that there is a train every three minutes on the Western Railway in Mumbai?"
line[4]=" The average length of a YouTube video is 2:37 minutes. You've officially bypassed that!"
line[5]=" There are 31,557,600 seconds in a year. And you just spent 240 of those on our site!"

line[6]=" Everything is so nice and colourful here! Wouldn't you like to stay here forever?";
line[7]=" Living inside a website wouldn't that be something?";
line[8]=" Who knows, maybe we'll be able to do that someday.";
line[9]=" We would never leave.";
line[10]=" Did you know that lightning strikes 100 times every second? So that's 3900 lightning bolts for the time you've spent here!";
line[11]=" You\'ve now been here for 7 minutes! Did you know that Safari's browser market share is almost 7%?";
line[12]=" Today is the first day of the rest of your life. Think about it.";
line[13]=" If the sun stopped shining suddenly, it would take eight minutes for people on earth to be aware of the fact.";
line[14]=" We\'re starting to think you're a little bit addicted now.";
line[15]=" You have our attention. We'd really like to know who you are.";
line[16]=" So write to us, already!";
//Specify font size for scoller
var ts_fontsize="16px"
var scroll_width=0;
//--Don't edit below this line

var longestmessage=1
for (i=2;i<line.length;i++){
if (line[i].length>line[longestmessage].length)
longestmessage=i
 scroll_width = line[i]/length
}
//Auto set scroller width
var tscroller_width=line[longestmessage].length
lines=line.length-1 //--Number of lines
temp=""
nextchar=-1;
nextline=1;
cursor="\\"
msgflag=0;
function animate()
{
	tscroller_width = (line[nextline].length-2);
	document.bannerform.banner.size = tscroller_width;
	if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines)
	{
		nextline++;
		nextchar=-1;
		document.bannerform.banner.value=temp;
		temp="";
		setTimeout("nextstep()",27000)
		setTimeout("hidedivmsg()",5000)	
	}
	else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length)
	{
		setTimeout("hidedivmsg()",5000)		
	}
	else{
		nextstep()
	}
}
function hidedivmsg()
{
	 $("#msguser").hide();
}
function nextstep()
{
	$("#msguser").fadeIn("slow");
	if (cursor=="\\"){
	cursor="|"}
	else if (cursor=="|"){
	cursor="/"}
	else if (cursor=="/"){
	cursor="-"}
	else if (cursor=="-"){
	cursor="\\"}
	nextchar++;
	temp+=line[nextline].charAt(nextchar);
	document.bannerform.banner.value=temp+cursor
	setTimeout("animate()",25)
}
