/***********************************************
* Safe email links
***********************************************/

function hideEmail() {
	var s1 = "info";
	var s2 = "@";
	var s3 = "kraftdaze.com";
	var s4 = "?Subject=Enquiry%20from%20" + s3;
	var s5 = s1 + s2 + s3;
	document.write("<a href=" + "mail" + "to:" + s1 + s2 + s3 + s4 + ">" + s5 + "</a>");
}


/***********************************************
* cmxform
***********************************************/

$(document).ready(function() {
	
	if(jQuery.browser.mozilla) {
		$('form.cmxform').hide().find('label:not(.nocmx)').each(function(){
			var $labelContent = $(this).html();
			var $labelWidth = $(this).css('width');
			$(this).empty();
			$(this).append('<span style="display: block; width: '+$labelWidth+';">');
			$(this).prepend('</span>');
			$(this).css('display', '-moz-inline-box');
			$(this).find('span').html($labelContent);
			$('form.cmxform').show();
		});
	};
	
	$("#listings").click(function () {
		$("#addItems").submit();
	});
	
});


/***********************************************
* Calling external link instead of target="_blank"
***********************************************/


function externalLinks() { 

if (!document.getElementsByTagName) return; 

var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
var relvalue = anchor.getAttribute("rel");

if (anchor.getAttribute("href")) {
var external = /external/;
var relvalue = anchor.getAttribute("rel");
if (external.test(relvalue)) { anchor.target = "_blank"; }
} 
}
} 
window.onload = externalLinks;



/***********************************************
* Added by programmer 									"
***********************************************/
