// ------------------------------// IBtable functions// ------------------------------var IBframeFS = parent.document.getElementById("IBframe");var IBtableFS = parent.document.getElementById("frameIBtable");var IBviewFS = parent.document.getElementById("Body");var IBframeWin = parent.top;var IBtableWin = parent.top.frames['frameIBtable'];var IBviewWin = parent.top.frames['Body'];function IBviewHistoryGo(){	if ( IBframeWin.IBviewLocation == '') {		IBviewWin.history.go(-1);		return;		}	IBviewWin.location.href = IBframeWin.IBviewLocation;	}function IBtableAct(Act,UnID,vars){	var Link='/' + WebDbName +"/IBtableAct?OpenAgent&IBtable="+activeIBtable+"&Act="+Act+"&UnID="+UnID+vars;//	IBframeFS.rows = '100%,215';	IBtableWin.location.href = Link;}function openIBtable(){	showIBtable(true);	IBtableAct("open",'','');	}function closeIBtable(){	if (document.getElementById("close-v").src.indexOf('close-v.gif') > -1)		showIBtable(false)		else			showIBtable(true)		}function showIBtable(key){	var img = document.getElementById("close-v");	if (key){			if (img) img.src='close-v.gif';			IBframeFS.rows = '100%,215';		}else{			if (img) img.src='close-A.gif';			IBframeFS.rows = '100%,18';			}	}function openIBview(){	IBviewWin.location.href='/'+WebDbName+'/IBView?OpenForm&Count=30&Start=1&See=IBitens';	}function openIBitem(UnID) {	IBviewWin.location.href = '/'+ WebDbName+'/0/'+UnID+'?OpenDocument';	}function addIBitem(UnID, sModel){	IBtableAct("save",UnID,"&sModel="+sModel);	showIBtable(true)	}function doSalesOrder(u,key) {	IBviewWin.location.href = '/' + WebDbName + '/SalesOrder?OpenForm&User='+u+'&IBtable='+key;	}function removeIBtable(){	if (confirm('Deseja remover todos o itens deste Or\u00E7amento?')){		IBtableAct('removeIBtable','','');		}	}function addToChart(ip){	IBframeFS.src="/"+WebDbName+"/IBtableAct?OpenAgent&IBtable="+activeIBtable+"&Act=addToChart&IP=" + ip 	}function addToDav(ip){	IBframeFS.src="/"+WebDbName+"/IBtableAct?OpenAgent&IBtable="+activeIBtable+"&Act=addToDav&IP=" + ip 	}function Pop(theURL,winName,features) { 	window.open(theURL,winName,features);	}// ------------------------------// Cookies functions// ------------------------------function setCookie( Name, Value, Days) {	var exp = new Date();	exp.setTime(exp.getTime() + (Days*24*60*60*1000));	document.cookie = Name+"="+Value+"; path=/ ; expires="+exp.toGMTString(); 	}function getCookie( check_name ) {	var a_all_cookies = document.cookie.split( ';' );	var a_temp_cookie = '';	var cookie_name = '';	var cookie_value = '';	var b_cookie_found = false; 		for ( i = 0; i < a_all_cookies.length; i++ ){		a_temp_cookie = a_all_cookies[i].split( '=' );		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');		if ( cookie_name == check_name ){			b_cookie_found = true;			if ( a_temp_cookie.length > 1 ){				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );				}			return cookie_value; break;			}		a_temp_cookie = null;		cookie_name = '';		}	if ( !b_cookie_found ) return null;	}				// ------------------------------// Scroll functions// ------------------------------var marqueespeed=1;var pausespeed=0;var copyspeed=pausespeed;var run = 0;var prev=0;var actualwidth='';var actualheigth='';var scroll_content, ns_marquee;function populate(){scroll_area=document.getElementById("scroll_box");scroll_content= document.getElementById("scroll_content");scroll_content.style.left="0px";scroll_content.style.top="0px";scroll_time=setInterval("scrollmarquee()",20);scroll_next=document.getElementById("next");scroll_prev=document.getElementById("prev");}function tabScroll(i){	var maxNext = parseInt(scroll_content.style.left) + (scroll_content.offsetWidth - scroll_area.offsetWidth);	var maxPrev = parseInt(scroll_content.style.left)*-1;	var maxRun = (scroll_area.offsetWidth/2);	if(i == 1)		run=(maxNext > maxRun ) ? maxRun : maxNext;	else		run=(maxPrev > maxRun ) ? maxRun : maxPrev;	copyspeed=pausespeed}function scrollmarquee(){needNext = parseInt(scroll_content.style.left)>((scroll_content.offsetWidth - scroll_area.offsetWidth)*(-1));needPrev = parseInt(scroll_content.style.left)<0;if ( (needNext) && (scroll_next.className != 'next') ) scroll_next.className = 'next';if ( (needPrev) && (scroll_prev.className != 'previous') ) scroll_prev.className = 'previous';if ( (!needNext) && (scroll_next.className == 'next') ) scroll_next.className = 'next_grayed';if ( (!needPrev) && (scroll_prev.className == 'previous') ) scroll_prev.className = 'previous_grayed';if (prev==0){	if (needNext)		scroll_content.style.left=parseInt(scroll_content.style.left)-(run+copyspeed)+"px"}else{		if (needPrev)		scroll_content.style.left=parseInt(scroll_content.style.left)+(run+copyspeed)+"px"}run = 0;}function man(i) {document.getElementById("man").innerHTML=i;//document.getElementById("man").innerHTML+=i+'<br>';}
