


function GetContentWnd(){ return parent; }function OnSave(){var oWnd = GetContentWnd();window.external.addFavorite( oWnd.location.href, oWnd.document.title );return true;}
function OnEmail(){var oWnd = 	GetContentWnd();oWnd.location.href = "mailto:?subject="+oWnd.document.title+"&body="+oWnd.location.href;return true;}
function createCookie(name,value,days) {if (days) {var date = new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires = ";expires="+date.toGMTString();}else {expires = ''}document.cookie = name+"="+value+expires+";domain=ciuhandu.com;path=/;";}

function GetCookie(name) {var nameEQ = name + "=";var ca = document.cookie.split(';');for(var i=0;i < ca.length;i++) {var c = ca[i];while (c.charAt(0)==' ') {c = c.substring(1,c.length);}if (c.indexOf(nameEQ) == 0) {return c.substring(nameEQ.length,c.length);}}return null;}function DeleteCookie(name) {createCookie(name,0,-1);}function SetCookie(name,value,days) {if (days) {var date = new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires = ";expires="+date.toGMTString();}else {expires = ''}document.cookie = name+"="+value+expires+";domain=ciuhandu.com;path=/;";}
function readCookie(name) {var nameEQ = name + "=";var ca = document.cookie.split(';');for(var i=0;i < ca.length;i++) {var c = ca[i];while (c.charAt(0)==' ') {c = c.substring(1,c.length);}if (c.indexOf(nameEQ) == 0) {return c.substring(nameEQ.length,c.length);}}return null;}



function setStyle() {var style = readCookie("rxstyle");if (style != null) {setActiveStyleSheet(style, 0);}return null;}
function setActiveStyleSheet(title, reset) {if (!document.getElementsByTagName) {return;}var i, a, main;for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {a.disabled = true;if(a.getAttribute("title") == title) {a.disabled = false;}}}if (reset == 1) {createCookie("rxstyle", title, 30);}}
setStyle();


var field_length=0;function TabNext(obj,event,len,next_field) {if (event == "down") {field_length=obj.value.length;}else if (event == "up") {if (obj.value.length != field_length) {field_length=obj.value.length;if ((field_length == len) && !(isNaN(obj.value))) {   
next_field.focus();}}}}

function setClass(obj,id) {if (id != null) {obj.className = id;}return null;}
function resetClass(obj) {{obj.className = '';}return null;}



function format_value(fieldobj,max_len){var val = fieldobj.value;if (isNaN(val)) {return;}val = val.replace(/ /g,"");val.replace(" ","");var len = val.length;dif = max_len - len;if ((dif<0) || (len==0)) {val = '';}else for(i=0;i < dif;i++) {val = "0" + val;}fieldobj.value = val;}
function printDocument() {if (parseInt(navigator.appVersion) >= 4) {window.print();}}
function emailLink(str) {from = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';to   = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM';var newstr = '';var chr = '';for (i=0; i<str.length; i++){chr = str.charAt(i);index = from.indexOf(chr);if(index != -1){chr = to.charAt(index);}newstr = newstr + chr;}document.write('<a href="mailto:'+newstr+'">'+newstr+'</a>')
}
function JumpURL(url) {if (url != '') {window.location = url;}}
function printPage() {window.open("print","printpage","status=no,toolbar=no,menubar=no,location=no");}


var targetClass = "gbtn";var targetClassOver = "gbtn2";
Hover = {checkMouseover : function(event){var obj;if(window.event){obj = window.event.srcElement;}else if( event != null ){obj = ( event.target );if(obj.nodeName=="#text") {obj = obj.parentNode;}}
if (obj.className && targetClass == obj.className){Hover.hover(obj);}},
checkMouseout : function(event){var obj;if(window.event){obj = window.event.srcElement;}else{obj = (event.target.className ? event.target : event.target.parentNode);}if (obj.className && (obj.className == targetClassOver)){Hover.hoverOff(obj);}},






hover : function(el) {el.className= targetClassOver;if(el.blur()) {el.blur();}},
hoverOff : function(el) {el.className= targetClass;if(el.blur()) {el.blur();}}};

document.onmousedown = Hover.checkMouseover;document.onmouseup = Hover.checkMouseout;document.onmouseout = Hover.checkMouseout;

function GetContentWnd(){return parent;}function CM(CMID){var oWnd = GetContentWnd();width=680;height=500;if(navigator.userAgent.indexOf("Mac")!=-1){height=height+70;}this_parent = oWnd.location.protocol+'/'+'/'+oWnd.location.host; 
window.open(this_parent+'/reports/cm/?'+CMID,'cm','width='+width+',height='+height+',toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=yes,copyhistory=no,status=no,resizable=yes,left=10,screenX=50,top=10,screenY=50');}

function checkFormCheckboxes()
{if (!document.getElementsByTagName) {return true;} 
var i, x;for(i=0; (x = document.getElementsByTagName("input")[i]); i++) {if(x.type == "checkbox")
{if(x.checked == true) { return true; } 
}}
alert('Please make a selection!');return false;}

function maxWin()
{if (self.innerWidth)
{frameWidth = self.innerWidth;frameHeight = self.innerHeight;}else if (document.documentElement && document.documentElement.clientWidth)
{frameWidth = document.documentElement.clientWidth;frameHeight = document.documentElement.clientHeight;}else if (document.body)
{frameWidth = document.body.clientWidth;frameHeight = document.body.clientHeight;}else return;
if (self.screen.width < frameWidth *2 || self.screen.height < frameHeight *2)
{newWidth = self.screen.width;newHeight = self.screen.height;if (document.layers)
{tmp1 = parent.outerWidth - parent.innerWidth;tmp2 = parent.outerHeight - parent.innerHeight;newWidth -= tmp1;newHeight -= tmp2;}parent.window.resizeTo(newWidth,newHeight);parent.window.moveTo(0,0);}}


