function LinkPage (url)
{
	document.body.style.cursor='wait';
	for (var i=0; i<document.styleSheets.length; i++) 
	{
		if (document.styleSheets[i].title=='extlinkStyleSheet')
		{
			if (document.styleSheets[i].cssRules)
			{
				while(document.styleSheets[i].cssRules.length>0)
				{
					document.styleSheets[i].deleteRule(document.styleSheets[i].cssRules.length-1);
				}
			}
			else if (document.styleSheets[i].rules)
			{
				while(document.styleSheets[i].rules.length>0)
				{
					document.styleSheets[i].removeRule(document.styleSheets[i].rules.length-1);
				}
				
			}

			document.styleSheets[i].disabled=true;
			break;
		}
	}
	new Ajax.Updater('workarea', '/ajax/go_extlink.php?url='+encodeURIComponent(url), {evalScripts: true, method: 'get', onComplete: function () {document.body.style.cursor='auto';} });
}

function addRule (_class, _rule)
{
	for (var i=0; i<document.styleSheets.length; i++) 
	{
		
		if (document.styleSheets[i].title=='extlinkStyleSheet')
		{
			styleSheet=document.styleSheets[i];
			break;
		}
	}

	if (styleSheet.addRule)
		styleSheet.addRule(_class, _rule, 0);
	else if (styleSheet.insertRule)
		styleSheet.insertRule(_class+' '+_rule, 0);
}

function setStyles()
{
	for (var i=0; i<document.styleSheets.length; i++) 
	{
		if (document.styleSheets[i].title=='extlinkStyleSheet')
		{
			document.styleSheets[i].disabled=false;
			return true;
		}
	}
	var cssNode = document.createElement('style');
	cssNode.type = 'text/css';
	cssNode.media = 'screen';
	cssNode.title = 'extlinkStyleSheet';
	document.getElementsByTagName("head")[0].appendChild(cssNode);
}

function myFormSubmit (ob)
{
	for (i=0; i<ob.elements.length; i++)
		ob.elements[i].name = ob.elements[i].name.substr(9);
	if (ob.name)
		ob.name=ob.name.substr(9);

	document.body.style.cursor='wait';
	document.body.previousSibling.removeChild(document.body.previousSibling.lastChild);
	if (ob.method.toLowerCase() == 'post')
	{
		new Ajax.Updater('workarea', '/ajax/go_extlink.php?url='+encodeURIComponent(ob.action), {evalScripts: true, method: ob.method, parameters:Form.serialize(ob), onComplete: function () {document.body.style.cursor='auto';} });
	}
	else
	{
		str_str='';
		for (i=0; i<ob.elements.length; i++)
		{
			if(ob.elements[i].name)
			{
				str_str += '&'+ob.elements[i].name+'='+encodeURIComponent(ob.elements[i].value);
			}
		}
		str_str=str_str.substr(1);
		new Ajax.Updater('workarea', '/ajax/go_extlink.php?url='+encodeURIComponent(ob.action+'?'+str_str), {EvalScripts: true, method: ob.method, parameters:Form.serialize(ob), onComplete: function () {document.body.style.cursor='auto';} });
	}
}