
function getObj(name)
{
	if (document.getElementById)
	{
		this.obj = document.getElementById(name);
	}
	else if (document.all)
	{
		this.obj = document.all[name];
	}
	else if (document.layers)
	{
		this.obj = document.layers[name];
	}

return this.obj;
}

function LoadTools(DIV) {
	getObj(DIV).innerHTML = "<img src='/myimages/newsloader.gif' width='16' height='16' style='padding-top:125px; padding-left:100px;'>"; 
	var httpReq = new ajaxObject('/myincludes/tools_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Action=LoadTools";
	httpReq.update(data,'POST');	
}

function LoadCover(DIV) {
	getObj(DIV).innerHTML = "<img src='/myimages/ajax-loader2.gif' width='32' height='32' style='padding-top:90px; padding-left:70px;'>"; 
	var httpReq = new ajaxObject('/myincludes/cover_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Action=LoadCover";
	httpReq.update(data,'POST');
	CoverArticles('CoverArticles');
}


function ShowNewsletter(DIV) {
	//getObj(DIV).innerHTML = "<img src='http://www.shape.gr/myimages/ajax-loadernewslet.gif' width='32' height='32' style='padding-top:90px; padding-left:70px;'>"; 
	var httpReq = new ajaxObject('/myincludes/mlist_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Action=ShowNewsletter";
	httpReq.update(data,'POST');	
}


function Newslet(DIV) {
	if (!document.NewsFrm.t[0].checked && !document.NewsFrm.t[1].checked) {
		alert('Επιλέξτε Εγγραφή/Διαγραφή...');	
	}
	else {
		if (document.NewsFrm.t[0].checked) {
			var type = 1;	
		}
		else if (document.NewsFrm.t[1].checked) {
			var type = 0;	
		}	
	//getObj(DIV).innerHTML = "<img src='http://www.shape.gr/myimages/newsloader.gif' width='16' height='16'>"; 
	var httpReq = new ajaxObject('/myincludes/mlist_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "type=" + type;
	data += "&email=" + getObj('email').value;
	data += "&Action=Newslet";
	httpReq.update(data,'POST');	
	}
}


function ShowDir(DIV) {
	//getObj(DIV).innerHTML = "<img src='http://www.shape.gr/myimages/ajax-loadernewslet.gif' width='32' height='32' style='padding-top:90px; padding-left:70px;'>"; 
	var httpReq = new ajaxObject('/myincludes/dir_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Action=ShowDir";
	httpReq.update(data,'POST');	
}


function ResetOn(ID) {
	getObj(ID).value = '';
}


function ResetOut(ID,VAL) {
	if (getObj(ID).value == '') {
		getObj(ID).value = VAL;
	}
}


function SendDir(DIV) {
	var form = document.DirFrm;	
	if (trimAll(form.name.value) == '' || trimAll(form.name2.value) == '' || trimAll(form.tel.value) == '' || trimAll(form.text.value) == '' || form.cat.options[form.cat.selectedIndex].value == 0) {
		alert('Συμπληρώστε όλα τα απαραίτητα στοιχεία(*)...');
	}
	else if (trimAll(form.name.value) == '* Επωνυμία' || trimAll(form.name2.value) == '* Υπεύθυνος' || trimAll(form.tel.value) == '* Τηλέφωνο' || trimAll(form.text.value) == '* Περιγραφή') {
		alert('Συμπληρώστε όλα τα απαραίτητα στοιχεία(*)...');
	}
	else {		
	//getObj(DIV).innerHTML = "<img src='http://www.shape.gr/myimages/ajax-loadernewslet.gif' width='32' height='32' style='padding-top:90px; padding-left:70px;'>"; 
	var httpReq = new ajaxObject('/myincludes/dir_model.php', function fin(responseTxt,responseStat) {
	//getObj(DIV).innerHTML = '';	
	if (responseTxt == '[OK]') {
		alert('Επιτυχής εγγραφή! Μετά απο σχετικό έλεγχο, η εταιρία σας θα προβληθεί στο business directory του SHAPE!');
		form.name.value = '';
		form.name2.value = '';
		form.tel.value = '';
		form.url.value = '';
		form.cat.selectedIndex.value = 0;
		form.text.value = '';
		location.href='/businessdirectory.html';
	}
	else {
		alert('Παρουσιάστηκε πρόβλημα κατά την εγγραφή...\nΞαναπροσπαθήστε!');
	}
}
);
	var data = "";
	data += "name=" + form.name.value;
	data += "&name2=" + form.name2.value;
	data += "&tel=" + form.tel.value;
	data += "&url=" + form.url.value;
	data += "&cat=" + form.cat.value;
	data += "&text=" + form.text.value;
	data += "&Action=SendDir";	
	httpReq.update(data,'POST');	
	}
}

function ResizeDir(H){
	getObj('DirIn').style.height = H + 'px';	
}

function ShowPoll(DIV) {
	getObj(DIV).innerHTML = "<img src='/myimages/ajax-loadernewslet.gif' width='32' height='32' style='padding-top:90px; padding-left:70px;'>"; 
	var httpReq = new ajaxObject('/myincludes/poll_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Action=ShowPoll";
	httpReq.update(data,'POST');	
}

function ShowForum(DIV) {
	var httpReq = new ajaxObject('/myincludes/forum_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Action=ShowForum";
	httpReq.update(data,'GET');	
}

function ShowForumNew(DIV) {
	getObj('ForumPreloader').style.display = 'block';
	var httpReq = new ajaxObject('/myincludes/forum_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;
	getObj('ForumPreloader').style.display = 'none';
}
);
	var data = "";
	data += "Action=ShowForumNew";
	httpReq.update(data,'GET');	
}

function ShowIndexTabs(DIV,TYPE,CID) {
	var httpReq = new ajaxObject('/myincludes/indextabs_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "Type=" + TYPE;
	data += "&cid=" + CID;
	data += "&Action=ShowIndexTabs";
	httpReq.update(data,'GET');	
}

function ShowWebLinks(DIV) {
	var httpReq = new ajaxObject('/myincludes/weblinks_model.php', function fin(responseTxt,responseStat) {
	getObj(DIV).innerHTML = responseTxt;	
}
);
	var data = "";
	data += "&Action=ShowWebLinks";
	httpReq.update(data,'GET');	
}

function ResetMe(What,Val,Type) {
/*if (Type == 1) {
		eval('document.NewLogFrm.' + What + '.value='';');
}
else if (Type == 2) {
	if (Val=='username' || Val=='password') {
		eval('document.NewLogFrm.' + What + '.value='';');
	}	
}*/
}