//News Scroll - splits in messages - 1: title 2: text 3: linktext 4:link
var isMacIE = ((navigator.userAgent.indexOf('MSIE')!= -1) && (navigator.userAgent.indexOf('Mac')!= -1));
var rotate=true

function go150()
	{
		var scrW=screen.width;
		var scrH=screen.height;	
		var scbar = "no" ;
		var tbar = "no" ;
	
		var bars = "menubar=no,toolbar=no" ;
		if( tbar == "yes" ) bars = "menubar=yes,toolbar=yes" ;
	
		var strwindow = "toolbar=no, width=" + scrW + ", height=" + scrH + ",directories=no,status=no,scrollbars="+
	                      scbar+"," + bars + ",resizable=no" + ",top=0, left=0";
						  
		if (navigator.appName == "Microsoft Internet Explorer")
		{
			strwindow = "toolbar=no, width=" + (scrW-7) + ", height=" + (scrH-35) + ",directories=no,status=no,scrollbars="+
	                      scbar+"," + bars + ",resizable=no" + ",top=0, left=0";
		} 
	
		file_path = 'http://www.nizamsons.com';
		windowic = window.open(file_path, "main", strwindow);
	}
// browser stuff, referencing objects

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id)
{
 if (isDOM) return document.getElementById(id);
 if (isIE4) return document.all[id];
 if (isNS4) return document.layers[id];
}

function getSty(id)
{
 return (isNS4 ? getRef(id) : getRef(id).style);
} 

var message= new Array()
// use | to seperate header, message, link test and link
// use ^ to add line breaks within the message
message[0]="Nizam's&#174;|Here you will find latest information on our product lines, technical product information,quality control and quality policies, news and particularly access to our Image Library and more by asking in feedback form. You will find this site very informative and helpful in your required information. Please don't hesitate to forward us your valuable comments and inquiries you may have. |"
//message[1]="LiberTex| Longing for summer? Check out our new range of summer tops, Denim Pants and Shirts. |<br>Click here |products.htm"
//message[2]="New Products| We have launched new products in different sections, for checking all new and imazing prodcuts, |click here now!|products.htm"
var copywidth=336
var scrolltop=393
var scrollleft=10
var scrollborder=0
var scrollheight=100
var titlebg="FFFFFF"
var copybg="FFFFFF"
var scrollbg="FFFFFF"
var targetlink="_new"
var titlealign="left"
var copyalign="left"
var standstill=4000
var cliptop=0
var clipbottom=0
var clipleft=0
var clipright=copywidth
var i_message=0
var mes_joined
var mes_split
var contenttext
var contentbg=""
var step=1
var pause=30

if(isMacIE){
	scrolltop=393
	scrollleft=5
	scrollheight=52
}

function init() {
		mes_joined=message[i_message]
		mes_split=mes_joined.split("|")
		mes_split2=mes_split[1].split("^")

		contenttext="<table cellpadding=0 cellspacing=0 border=0>"
		contenttext+="<tr valign='top'>"
		contenttext+="<td align="+titlealign+" width="+copywidth+" bgcolor='"+titlebg+"' class='em'>"
		contenttext+="<font class='heading'>"
		contenttext+=mes_split[0]
		contenttext+="</font></td></tr>"
		contenttext+="<tr><td align="+copyalign+" width="+copywidth+" bgcolor='"+copybg+"' class='em'>"
		if (mes_split2.length > 1) {
			for (i = 0; i < mes_split2.length; i++) {
				contenttext+=mes_split2[i] + "<br>";
			}
		} else {
			contenttext+=mes_split[1];
		}
		contenttext+="<a class=\"news\" href=\""+ mes_split[3] +"\">"+ mes_split[2] +"</a>&gt;&gt;"
		contenttext+="</font></td></tr>"
		contenttext+="</table>"
		
		var bg_width=copywidth+2*scrollborder
		var bg_height=scrollheight+2*scrollborder
		
		contentbg="<table width="+bg_width+" height='"+bg_height+"' cellpadding=0 cellspacing=0 border='"+scrollborder+"'><tr><td bgcolor='"+scrollbg+"'>&nbsp;</td></tr></table>"
	if (isDOM) {
		getRef("scrolltext").innerHTML=contenttext
		//getRef("scrollbg").innerHTML=contentbg
		getSty("scrolltext").posTop=scrolltop+scrollheight
		getSty("scrolltext").posLeft=scrollleft
		//getSty("scrollbg").posTop=scrolltop-scrollborder
		//getSty("scrollbg").posLeft=scrollleft-scrollborder
		getSty("scrolltext").clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		scrollin()
	}
	if (isIE4) {
		scrolltext.innerHTML=contenttext
		//scrollbg.innerHTML=contentbg
		document.all.scrolltext.style.posTop=scrolltop+scrollheight
		document.all.scrolltext.style.posLeft=scrollleft
		//document.all.scrollbg.style.posTop=scrolltop-scrollborder
		//document.all.scrollbg.style.posLeft=scrollleft-scrollborder
		document.all.scrolltext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		scrollin()
	}
	if (isNS4) {
		document.scrolltext.document.write(contenttext)
		document.scrolltext.document.close()
		//document.scrollbg.document.write(contentbg)
		//document.scrollbg.document.close()
		document.scrolltext.top=scrolltop+scrollheight
		document.scrolltext.left=scrollleft
		//document.scrollbg.top=scrolltop-scrollborder
		//document.scrollbg.left=scrollleft-scrollborder
		document.scrolltext.clip.left=clipleft
        document.scrolltext.clip.right=clipright
        document.scrolltext.clip.top=cliptop
        document.scrolltext.clip.bottom=clipbottom
		scrollin()
	}
}

function scrollin(){
	if (isDOM){
		if (getSty("scrolltext").posTop>scrolltop) {
			clipbottom+=step
			getSty("scrolltext").clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			getSty("scrolltext").posTop-=step
			var timer=setTimeout("scrollin()",pause)
		}
		else {
			clearTimeout(timer)
			if (rotate){
			var timer=setTimeout("scrollout()",standstill)
			}
		}
	}
	if (isIE4){
		if (document.all.scrolltext.style.posTop>scrolltop) {
			clipbottom+=step
			document.all.scrolltext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			document.all.scrolltext.style.posTop-=step
			var timer=setTimeout("scrollin()",pause)
		}
		else {
			clearTimeout(timer)
			if (rotate){
			var timer=setTimeout("scrollout()",standstill)
			}
		}
	}
	if (isNS4){
		if (document.scrolltext.top>scrolltop) {
			clipbottom+=step
			document.scrolltext.clip.left=clipleft
        	document.scrolltext.clip.right=clipright
        	document.scrolltext.clip.top=cliptop
        	document.scrolltext.clip.bottom=clipbottom
			document.scrolltext.top-=step
			var timer=setTimeout("scrollin()",pause)
		}
		else {
			clearTimeout(timer)
			if (rotate){
			var timer=setTimeout("scrollout()",standstill)
			}
		}
	}
}

function scrollout(){
	if (isDOM){
		if (getSty("scrolltext").posTop>(scrolltop-scrollheight)) {
			cliptop+=step
			if(isMacIE){
				getSty("scrolltext").clip="rect("+(cliptop+50)+" "+clipright+" "+clipbottom+" "+clipleft+")"
			}else{
				getSty("scrolltext").clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			}
			getSty("scrolltext").posTop-=step
			var timer=setTimeout("scrollout()",pause)
		}
		else {
			clearTimeout(timer)
			changemessage()
		}
	}
	if (isIE4){
		if (document.all.scrolltext.style.posTop>(scrolltop-scrollheight)) {
			cliptop+=step
			if(isMacIE){
				document.all.scrolltext.style.clip="rect("+(cliptop+50)+" "+clipright+" "+clipbottom+" "+clipleft+")"
			}else{
				document.all.scrolltext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
			}
			document.all.scrolltext.style.posTop-=step
			var timer=setTimeout("scrollout()",pause)
		}
		else {
			clearTimeout(timer)
			changemessage()
		}
	}
	if (isNS4){
		if (document.scrolltext.top>(scrolltop-scrollheight)) {
			cliptop+=step
			document.scrolltext.clip.left=clipleft
        	document.scrolltext.clip.right=clipright
        	document.scrolltext.clip.top=cliptop
        	document.scrolltext.clip.bottom=clipbottom
			document.scrolltext.top-=step
			var timer=setTimeout("scrollout()",pause)
		}
		else {
			clearTimeout(timer)

			changemessage()
		}
	}
}

function changemessage(){
		i_message++
		if (i_message>message.length-1) {i_message=0}
		mes_joined=message[i_message]
		mes_split=mes_joined.split("|")
		cliptop=0
		clipbottom=0
		
		mes_split2=mes_split[1].split("^")

		contenttext="<table cellpadding=0 cellspacing=0 border=0>"
		contenttext+="<tr valign='top'>"
		contenttext+="<td align="+titlealign+" width="+copywidth+" bgcolor='"+titlebg+"' class='em'>"
		contenttext+="<font class='heading'>"
		contenttext+=mes_split[0]
		contenttext+="</font></td></tr>"
		contenttext+="<tr><td align="+copyalign+" width="+copywidth+" bgcolor='"+copybg+"' class='em'>"
		if (mes_split2.length > 1) {
			for (i = 0; i < mes_split2.length; i++) {
				contenttext+=mes_split2[i] + "<br>";
			}
		} else {
			contenttext+=mes_split[1];
		}
		contenttext+="<a class=\"news\" href=\""+ mes_split[3] +"\">"+ mes_split[2] +"</a>&gt;&gt;"
		contenttext+="</font></td></tr>"
		contenttext+="</table>"
	if (isDOM) {
		getRef("scrolltext").innerHTML=contenttext
		getSty("scrolltext").posTop=scrolltop+scrollheight
		getSty("scrolltext").posLeft=scrollleft
		getSty("scrolltext").clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		scrollin()
	}
	if (isIE4) {
		scrolltext.innerHTML=contenttext
		document.all.scrolltext.style.posTop=scrolltop+scrollheight
		document.all.scrolltext.style.posLeft=scrollleft
		document.all.scrolltext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		scrollin()
	}
	if (isNS4) {
		document.scrolltext.document.write(contenttext)
		document.scrolltext.document.close()
		document.scrolltext.top=scrolltop+scrollheight
		document.scrolltext.left=scrollleft
		document.scrolltext.clip.left=clipleft
        document.scrolltext.clip.right=clipright
        document.scrolltext.clip.top=cliptop
        document.scrolltext.clip.bottom=clipbottom
		scrollin()
	}
}
