//window.onerror = function() {return true}

function ss(o) {
	if (o) o.select();
}

function se(o) {
	if (o) {
		o.value = o.value + ' ';
		o.value = o.value.substr(0, o.value.length - 1);
	}
}

function trim(str) {
	return str.replace(/^\s*/, '').replace(/\s*$/, '');
}

function encodeRE(s) {
	return s.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1');
	//alert(eval('/' + encodeRE('-bla-bla.') + '/'));
}

function wo(o, width, height, extra) {
	if (!o.name) o.name = 'popup_window';
	if (!width) width = 500;
	if (!height) height = 400;

	var params = [];
	params[params.length] ='width=' + width;
	params[params.length] ='height=' + height;

	var w = window.open(o.href, o.name + '_popup', params.join(',') + (extra ? ',' + extra : ''));
	if (typeof(w) != 'undefined') w.focus();
	return false;
}

function wc(url) {
	if (opener) {
		if (opener.closed) window.open(url, '');
		else if (opener.location.href.search(url) == -1) opener.location.href = url;
		opener.focus();
		self.close();
		return false;
	}
	return true;
}

function setCookie(name, value, expires, path, domain, secure) {
	document.cookie = name + "=" + escape(value) + (expires ? ";expires=" + expires.toGMTString() : "") + (path ? ";path=" + path : "") + (domain ? ";domain=" + domain : "") + (secure ? ";secure" : "");
}

function getCookie(name) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return null;
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		c = new Date();
		c.setTime(c.getTime() - 1000);
		document.cookie = name + "=" + (path ? ";path=" + path : "") + (domain ? ";domain=" + domain : "") + ";expires=" + c.toGMTString() + ";";
	}
}

var COOKIE_PREFFIX = 'FXC-';


function enCallback()
{
	var wind = window; 
	var winop = wind.open; 
	winop('http://www.ringcentral.com/ringme/?uc=55787941,0,&s=no&v=2', 'Callback_RingMe', 'resizable=no,width=380,height=240'); 
}

function ruCallback()
{
	var wind = window; 
	var winop = wind.open; 
	winop('http://www.ringcentral.com/ringme/?uc=55938648,0,&s=no&v=2', 'Callback_RingMe', 'resizable=no,width=380,height=240'); 
}

function cnCallback()
{
	var wind = window; 
	var winop = wind.open; 
	winop('http://www.ringcentral.com/ringme/?uc=56028878,0,&s=no&v=2', 'Callback_RingMe', 'resizable=no,width=380,height=240'); 
}

function YouTube(id,w,h)
{
	document.write('<object width="'+w+'" height="'+h+'"><param name="movie" value="http://www.youtube.com/v/'+id+'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+id+'" type="application/x-shockwave-flash" wmode="transparent" width="'+w+'" height="'+h+'"></embed></object>');
}

function printSpecial(elementID, gAutoPrint)
{
    if (document.getElementById != null)
    {
        var html = '<HTML>\n<HEAD>\n';
        
        if (document.getElementsByTagName != null)
        {
            var headTags = document.getElementsByTagName("head");
            if (headTags.length > 0)
            html += headTags[0].innerHTML;
        }
        
        html += '\n</HEAD>\n<BODY>\n';
        
        var printReadyElem = document.getElementById(elementID);
        
        if (printReadyElem != null)
        {
            html += printReadyElem.innerHTML;
            // regexp remove "print page" link
            html = html.replace(/<a href="javascript:void\(print.*<\/a>/ig, '');
        }
        else
        {
            alert("Could not find the printReady function");
            return;
        }
        html += '\n</BODY>\n</HTML>';
        
        printWin = window.open("", elementID);
        printWin.document.open();
        printWin.document.write(html);
        printWin.document.close();
        if (gAutoPrint) setTimeout('printWin.print()', 500);
    }
    else
    {
        alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
    }
}
onReady = (function(ie){
 var d = document;
 return ie ? function(c){
   var n = d.firstChild,
    f = function(){
     try{
      c(n.doScroll('left'))
     }catch(e){
      setTimeout(f, 10)
     }
    }; f()
  } : 
  /webkit|safari|khtml/i.test(navigator.userAgent) ? function(c){
   var f = function(){
     /loaded|complete/.test(d.readyState) ? c() : setTimeout(f, 10)
    }; f()
  } : 
  function(c){
   d.addEventListener("DOMContentLoaded", c, false);
  }
})(/*@cc_on 1@*/);

onReady(function(){
 var so = new SWFObject("/customfiles/Flash/footer.swf","rs","278","149","7");
            so.addParam('wmode', 'opaque');
            so.addParam("allowScriptAccess", "sameDomain");
            so.addParam("menu", "false");
            so.addParam("salign", "t");
            so.write("rs");
});


