var delayb4scroll=500 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

var copyspeed_cust=marqueespeed
var pausespeed_cust=(pauseit==0)? copyspeed_cust: 0
var actualheight_cust=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function scrollmarqueecust(){
if (parseInt(cross_marquee_cust.style.top)>(actualheight_cust*(-1)+8))
cross_marquee_cust.style.top=parseInt(cross_marquee_cust.style.top)-copyspeed_cust+"px"
else
cross_marquee_cust.style.top=parseInt(marqueeheight_cust)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",50)', delayb4scroll)
}

function initializemarqueecust(){
cross_marquee_cust=document.getElementById("vmarqueecust")
cross_marquee_cust.style.top=0
marqueeheight_cust=document.getElementById("marqueecontainercust").offsetHeight
actualheight_cust=cross_marquee_cust.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee_cust.style.height=marqueeheight_cust+"px"
cross_marquee_cust.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarqueecust()",50)', delayb4scroll)
}

if (window.addEventListener) {
window.addEventListener("load", initializemarquee, false);
window.addEventListener("load", initializemarqueecust, false);
}
else if (window.attachEvent) {
window.attachEvent("onload", initializemarquee);
window.attachEvent("onload", initializemarqueecust);
}
else if (document.getElementById) {
window.onload=initializemarquee;
window.onload=initializemarqueecust;
}

function imposeMaxLength(Object, MaxLen)
{	
  	document.getElementById("char").innerHTML=(3000-eval(Object.value.length)) + " characters left";
  	if(Object.value.length>MaxLen)
  		Object.value=Object.value.substring(0,MaxLen)
 	return (Object.value.length <= MaxLen);
}
function clrQuestion(arg) {
	if(arg==0) {
		if(document.thisQuestion.Question.value=="Type your question here...")
			document.thisQuestion.Question.value="";
	}
	if(arg==1) {
		if(document.thisQuestion.Question.value=="")
			document.thisQuestion.Question.value="Type your question here...";
	}
}
function clrQuestion2(arg) {
	if(arg==0) {
		if(document.thisQuestion.Question.value=="Enter your question here...")
			document.thisQuestion.Question.value="";
	}
	if(arg==1) {
		if(document.thisQuestion.Question.value=="")
			document.thisQuestion.Question.value="Enter your question here...";
	}
}
function fnQuestion(pg) 
{
	if(document.thisQuestion.Question.value=="" || document.thisQuestion.Question.value=="Type your question here..." || document.thisQuestion.Question.value=="Enter your question here..."){
		alert("Please enter the Question.");
		document.thisQuestion.Question.focus(); 
		return false;
	}	
	if(isNull(document.thisQuestion.Question,"Question.")){ return false; }
	if(document.thisQuestion.Category.value=="" || document.thisQuestion.Category.value=="Select"){
		alert("Please choose Expert Category.");
		document.thisQuestion.Category.focus(); 
		return false;
	}
	if (document.thisQuestion.Question.value.length>3000){
		alert("Please enter your Question not exceeding 3000 characters.");
		document.thisQuestion.Question.focus(); 
		return false;
	}
	
	if(pg!="tags_index")
	{
		var page=document.thisQuestion.Category.value;
		page=page.split("|");
		document.thisQuestion.action=page[2]+"/" + pg +".php?mode=save";
	}
	else
		document.thisQuestion.action="/" + pg +".php?mode=save";
}
